summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2021-06-19 19:56:54 +0100
committerAlex Harpin <development@landsofshadow.co.uk>2023-01-10 11:59:06 +0000
commit72af1407237f716282308c9288e7e7170343376e (patch)
tree30ab4b4119988526a6a53cef56781b36b08062f8
parent467c8a9d787b0005e05aa36154d7036b377b3221 (diff)
downloadnextcloud-server-72af1407237f716282308c9288e7e7170343376e.tar.gz
nextcloud-server-72af1407237f716282308c9288e7e7170343376e.zip
Move CAN_INSTALL check to method and remove unlink from SetupController
Move the check for the CAN_INSTALL file in the config directory to a method in the Setup class and remove the call to unlink from the SetupController as this in now handled in the Setup class. Signed-off-by: Alex Harpin <development@landsofshadow.co.uk>
-rw-r--r--core/Controller/SetupController.php8
-rw-r--r--lib/private/Setup.php9
2 files changed, 11 insertions, 6 deletions
diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php
index ab8b1973bf2..b4f41b48da2 100644
--- a/core/Controller/SetupController.php
+++ b/core/Controller/SetupController.php
@@ -59,7 +59,7 @@ class SetupController {
$post['dbpass'] = $post['dbpassword'];
}
- if (!is_file(\OC::$configDir.'/CAN_INSTALL')) {
+ if (!$this->setupHelper->canInstallExists()) {
$this->displaySetupForbidden();
return;
}
@@ -107,10 +107,8 @@ class SetupController {
}
\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');
- }
+ if ($this->setupHelper->canInstallExists()) {
+ \OC_Template::printGuestPage('', 'installation_incomplete');
}
header('Location: ' . \OC::$server->getURLGenerator()->getAbsoluteURL('index.php/core/apps/recommended'));
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index d1936f55f28..bd176984678 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -419,7 +419,7 @@ class Setup {
//and we are done
$config->setSystemValue('installed', true);
- if (\OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL')) {
+ if (self::canInstallExists()) {
unlink(\OC::$configDir.'/CAN_INSTALL');
}
@@ -599,4 +599,11 @@ class Setup {
'channel' => (string)$OC_Channel,
];
}
+
+ /**
+ * @return bool
+ */
+ public function canInstallExists() {
+ return \OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL');
+ }
}