diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-04-04 23:32:00 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-04-11 09:32:33 +0200 |
commit | 7e7146db7fdefa7039ad5dd9653500589a1d0c51 (patch) | |
tree | be21d5f37601376d96afb96e696b4fd12ef98bf4 /core/Controller/SetupController.php | |
parent | 7641a1589f23eaddbbf3a953746ef1bf6f5234f8 (diff) | |
download | nextcloud-server-7e7146db7fdefa7039ad5dd9653500589a1d0c51.tar.gz nextcloud-server-7e7146db7fdefa7039ad5dd9653500589a1d0c51.zip |
Block install without CAN_INSTALL file
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/Controller/SetupController.php')
-rw-r--r-- | core/Controller/SetupController.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index b9d561cb4c9..3dd02fc31dc 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -62,6 +62,11 @@ class SetupController { $post['dbpass'] = $post['dbpassword']; } + if (!is_file(\OC::$configDir.'/CAN_INSTALL')) { + $this->displaySetupForbidden(); + return; + } + if(isset($post['install']) AND $post['install']=='true') { // We have to launch the installation process : $e = $this->setupHelper->install($post); @@ -79,6 +84,10 @@ class SetupController { } } + private function displaySetupForbidden() { + \OC_Template::printGuestPage('', 'installation_forbidden'); + } + public function display($post) { $defaults = array( 'adminlogin' => '', @@ -101,6 +110,13 @@ class SetupController { unlink($this->autoConfigFile); } \OC::$server->getIntegrityCodeChecker()->runInstanceVerification(); + + if (\OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL')) { + if (!unlink(\OC::$configDir.'/CAN_INSTALL')) { + \OC_Template::printGuestPage('', 'installation_incomplete'); + } + } + \OC_Util::redirectToDefaultPage(); } |