From: Bart Visscher Date: Fri, 17 Feb 2012 21:01:53 +0000 (+0100) Subject: Move config.php writable test to update path X-Git-Tag: v4.0.0beta~201^2~43 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1fa05894d51235a46cf67812227d5e8363f87d54;p=nextcloud-server.git Move config.php writable test to update path This should make it possible to use owncloud with a read-only config.php --- diff --git a/lib/base.php b/lib/base.php index 8f169a5732f..880645ff79d 100644 --- a/lib/base.php +++ b/lib/base.php @@ -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())); } diff --git a/lib/util.php b/lib/util.php index 4ba04fff3e8..ee32d31bfd0 100644 --- a/lib/util.php +++ b/lib/util.php @@ -226,10 +226,6 @@ class OC_Util { $errors[]=array('error'=>'PHP module ctype is not installed.
','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; }