diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-11-18 23:47:00 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-11-25 11:14:35 +0100 |
commit | b68c07d68781b22bd15b655929d4e0b2d90bc7e0 (patch) | |
tree | bd2b0c9e81ef1bf280df547078285589614c7499 /core | |
parent | 6fb2477fb75d4c982a1568e2392d17fd7cc2fd4b (diff) | |
download | nextcloud-server-b68c07d68781b22bd15b655929d4e0b2d90bc7e0.tar.gz nextcloud-server-b68c07d68781b22bd15b655929d4e0b2d90bc7e0.zip |
autoconfig.php only to be deleted on successful installation
Diffstat (limited to 'core')
-rw-r--r-- | core/setup/controller.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/core/setup/controller.php b/core/setup/controller.php index 39272120106..5a52b18f73b 100644 --- a/core/setup/controller.php +++ b/core/setup/controller.php @@ -12,13 +12,21 @@ namespace OC\Core\Setup; use OCP\IConfig; class Controller { - /** @var \OCP\IConfig */ + /** + * @var \OCP\IConfig + */ protected $config; /** + * @var string + */ + private $autoConfigFile; + + /** * @param IConfig $config */ function __construct(IConfig $config) { + $this->autoConfigFile = \OC::$SERVERROOT.'/config/autoconfig.php'; $this->config = $config; } @@ -64,15 +72,17 @@ class Controller { } public function finishSetup() { + if( file_exists( $this->autoConfigFile )) { + unlink($this->autoConfigFile); + } \OC_Util::redirectToDefaultPage(); } public function loadAutoConfig($post) { - $autosetup_file = \OC::$SERVERROOT.'/config/autoconfig.php'; - if( file_exists( $autosetup_file )) { + if( file_exists($this->autoConfigFile)) { \OC_Log::write('core', 'Autoconfig file found, setting up owncloud...', \OC_Log::INFO); $AUTOCONFIG = array(); - include $autosetup_file; + include $this->autoConfigFile; $post = array_merge ($post, $AUTOCONFIG); } @@ -82,9 +92,6 @@ class Controller { if ($dbIsSet AND $directoryIsSet AND $adminAccountIsSet) { $post['install'] = 'true'; - if( file_exists( $autosetup_file )) { - unlink($autosetup_file); - } } $post['dbIsSet'] = $dbIsSet; $post['directoryIsSet'] = $directoryIsSet; |