]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move config.php writable test to update path
authorBart Visscher <bartv@thisnet.nl>
Fri, 17 Feb 2012 21:01:53 +0000 (22:01 +0100)
committerBart Visscher <bartv@thisnet.nl>
Fri, 17 Feb 2012 21:10:03 +0000 (22:10 +0100)
This should make it possible to use owncloud with a read-only config.php

lib/base.php
lib/util.php

index 8f169a5732f6d8666c58849a35fc1ba108374153..880645ff79d124c70b45ebf0dcb552a05da0adfc 100644 (file)
@@ -171,6 +171,13 @@ class OC{
                                        echo 'Error while upgrading the database';
                                        die();
                                }
+                               if(file_exists(OC::$SERVERROOT."/config/config.php") and !is_writable(OC::$SERVERROOT."/config/config.php")) {
+                                       $tmpl = new OC_Template( '', 'error', 'guest' );
+                                       $tmpl->assign('errors',array(1=>array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud")));
+                                       $tmpl->printPage();
+                                       exit;
+                               }
+
                                OC_Config::setValue('version',implode('.',OC_Util::getVersion()));
                        }
 
index 4ba04fff3e890af9dbb95aeb5a555af2377e020a..ee32d31bfd07ce0740d4b915e8782906a8e8d1f8 100644 (file)
@@ -226,10 +226,6 @@ class OC_Util {
                        $errors[]=array('error'=>'PHP module ctype is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
                }
 
-               if(file_exists(OC::$SERVERROOT."/config/config.php") and !is_writable(OC::$SERVERROOT."/config/config.php")){
-                       $errors[]=array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by giving the webserver use write access to the config directory in owncloud");
-               }
-
                return $errors;
        }