]> source.dussan.org Git - nextcloud-server.git/commitdiff
Execute the post setup check after finishing the setup
authorBart Visscher <bartv@thisnet.nl>
Wed, 6 Feb 2013 16:54:20 +0000 (17:54 +0100)
committerBart Visscher <bartv@thisnet.nl>
Wed, 6 Feb 2013 16:56:45 +0000 (17:56 +0100)
core/routes.php
core/setup.php
lib/base.php
lib/setup.php

index 7408858b107cb79c8c705d02d81fd5bad59f6895..2527816b662c13e65baa950e2dde498162aaea28 100644 (file)
@@ -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')
index 66b8cf378bd18d28995ba4e8dc62046b4f053410..f16385466cb8fcc0bf4ddcc4c8a0c65fd2bea1cc 100644 (file)
@@ -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();
        }
 }
index 6dab980dd0edec1f50a15133c8bcc9372b13f7f2..e195d305d5cdd03219ca46c4fd071061eeea0309 100644 (file)
@@ -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 <a href=\'%s\'>installation guides</a>.', '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();
index 4dd190b99fb159b858c28e79f1b52d6fd8ca2897..f342142c95794f6085d1929598cb288fa3fe0f9e 100644 (file)
@@ -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 <a href=\'%s\'>installation guides</a>.', '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();
+               }
+       }
 }