diff --git a/core/routes.php b/core/routes.php
index 7408858b10..2527816b66 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -6,6 +6,10 @@
* See the COPYING-README file.
*/
+// Post installation check
+$this->create('post_setup_check', '/post-setup-check')
+ ->action('OC_Setup', 'postSetupCheck');
+
// Core ajax actions
// Search
$this->create('search_ajax_search', '/search/ajax/search.php')
diff --git a/core/setup.php b/core/setup.php
index 66b8cf378b..f16385466c 100644
--- a/core/setup.php
+++ b/core/setup.php
@@ -43,7 +43,7 @@ if(isset($_POST['install']) AND $_POST['install']=='true') {
OC_Template::printGuestPage("", "installation", $options);
}
else {
- header("Location: ".OC::$WEBROOT.'/');
+ header( 'Location: '.OC_Helper::linkToRoute( 'post_setup_check' ));
exit();
}
}
diff --git a/lib/base.php b/lib/base.php
index 6dab980dd0..e195d305d5 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -547,28 +547,6 @@ class OC {
exit();
}
- // post installation checks
- if (!OC_Config::getValue("post-installation-checked", false)) {
- // setup was successful -> webdav testing now
- $request = OC_Request::getPathInfo();
- if(substr($request, -4) !== '.css' and substr($request, -3) !== '.js' and substr($request, -5) !== '.json') {
- if (OC_Util::isWebDAVWorking()) {
- OC_Config::setValue("post-installation-checked", true);
- } else {
- $l=OC_L10N::get('lib');
-
- $error = $l->t('Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.');
- $hint = $l->t('Please double check the installation guides.', 'http://doc.owncloud.org/server/5.0/admin_manual/installation.html');
-
- $tmpl = new OC_Template('', 'error', 'guest');
- $tmpl->assign('errors', array(1 => array('error' => $error, 'hint' => $hint)), false);
- $tmpl->printPage();
- exit();
- }
- }
- }
-
-
$request = OC_Request::getPathInfo();
if(substr($request, -3) !== '.js'){// we need these files during the upgrade
self::checkMaintenanceMode();
diff --git a/lib/setup.php b/lib/setup.php
index 4dd190b99f..f342142c95 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -610,4 +610,24 @@ class OC_Setup {
file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/.htaccess', $content);
file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/index.html', '');
}
+
+ /**
+ * @brief Post installation checks
+ */
+ public static function postSetupCheck($params) {
+ // setup was successful -> webdav testing now
+ if (OC_Util::isWebDAVWorking()) {
+ header("Location: ".OC::$WEBROOT.'/');
+ } else {
+ $l=OC_L10N::get('lib');
+
+ $error = $l->t('Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.');
+ $hint = $l->t('Please double check the installation guides.', 'http://doc.owncloud.org/server/5.0/admin_manual/installation.html');
+
+ $tmpl = new OC_Template('', 'error', 'guest');
+ $tmpl->assign('errors', array(1 => array('error' => $error, 'hint' => $hint)), false);
+ $tmpl->printPage();
+ exit();
+ }
+ }
}