Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-04-05 00:32:00 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2019-04-11 10:32:33 +0300
commit7e7146db7fdefa7039ad5dd9653500589a1d0c51 (patch)
treebe21d5f37601376d96afb96e696b4fd12ef98bf4 /core/Controller
parent7641a1589f23eaddbbf3a953746ef1bf6f5234f8 (diff)
Block install without CAN_INSTALL file
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/SetupController.php16
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();
}