File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ public function run($post) {
6262 $ post ['dbpass ' ] = $ post ['dbpassword ' ];
6363 }
6464
65+ if (!is_file (\OC ::$ configDir .'/CAN_INSTALL ' )) {
66+ $ this ->displaySetupForbidden ();
67+ return ;
68+ }
69+
6570 if (isset ($ post ['install ' ]) AND $ post ['install ' ]=='true ' ) {
6671 // We have to launch the installation process :
6772 $ e = $ this ->setupHelper ->install ($ post );
@@ -79,6 +84,10 @@ public function run($post) {
7984 }
8085 }
8186
87+ private function displaySetupForbidden () {
88+ \OC_Template::printGuestPage ('' , 'installation_forbidden ' );
89+ }
90+
8291 public function display ($ post ) {
8392 $ defaults = array (
8493 'adminlogin ' => '' ,
@@ -101,6 +110,11 @@ public function finishSetup() {
101110 unlink ($ this ->autoConfigFile );
102111 }
103112 \OC ::$ server ->getIntegrityCodeChecker ()->runInstanceVerification ();
113+
114+ if (\OC_Util::getChannel () !== 'git ' && is_file (\OC ::$ configDir .'/CAN_INSTALL ' )) {
115+ unlink (\OC ::$ configDir .'/CAN_INSTALL ' );
116+ }
117+
104118 \OC_Util::redirectToDefaultPage ();
105119 }
106120
Original file line number Diff line number Diff line change 1+ <div class="error">
2+ <h2><?php p ($ l ->t ('Error ' )) ?> </h2>
3+ <p>
4+ <?php p ($ l ->t ('It looks like you are trying to reinstall your Nextcloud. However the file CAN_INSTALL is missing from your config directory. Please create the file CAN_INSTALL in your config folder to continue. ' )) ?>
5+ </p>
6+ </div>
Original file line number Diff line number Diff line change @@ -111,6 +111,11 @@ public function upgrade() {
111111 $ this ->emit ('\OC\Updater ' , 'maintenanceEnabled ' );
112112 }
113113
114+ // Clear CAN_INSTALL file if not on git
115+ if (\OC_Util::getChannel () !== 'git ' ) {
116+ unlink (\OC ::$ configDir . '/CAN_INSTALL ' );
117+ }
118+
114119 $ installedVersion = $ this ->config ->getSystemValue ('version ' , '0.0.0 ' );
115120 $ currentVersion = implode ('. ' , \OCP \Util::getVersion ());
116121
You can’t perform that action at this time.
0 commit comments