diff options
author | Marvin Thomas Rabe <mrabe@marvinrabe.de> | 2012-05-01 14:47:40 +0200 |
---|---|---|
committer | Marvin Thomas Rabe <mrabe@marvinrabe.de> | 2012-05-01 16:35:46 +0200 |
commit | 7ded9cf520f74b595bc0f8939ac59249b47ccbc9 (patch) | |
tree | 39c6cf5f44f5bf5a846d38413f41156dbb683ff7 /lib | |
parent | d3ce2cacd6461ca7551b0faec2b0ee425bbbc51f (diff) | |
download | nextcloud-server-7ded9cf520f74b595bc0f8939ac59249b47ccbc9.tar.gz nextcloud-server-7ded9cf520f74b595bc0f8939ac59249b47ccbc9.zip |
Checks if config folder is writable on begin of the installation.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php index 2c05eb02599..5de5b8df384 100644 --- a/lib/util.php +++ b/lib/util.php @@ -20,10 +20,18 @@ class OC_Util { $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ); $CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", OC::$SERVERROOT."/backup" ); - // Create root dir + // Check if config folder is writable. + if(!is_writable(OC::$SERVERROOT."/config/")) { + $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; + } + + // Create root dir. if(!is_dir($CONFIG_DATADIRECTORY_ROOT)){ $success=@mkdir($CONFIG_DATADIRECTORY_ROOT); - if(!$success) { + if(!$success) { $tmpl = new OC_Template( '', 'error', 'guest' ); $tmpl->assign('errors',array(1=>array('error'=>"Can't create data directory (".$CONFIG_DATADIRECTORY_ROOT.")",'hint'=>"You can usually fix this by giving the webserver write access to the ownCloud directory '".OC::$SERVERROOT."' (in a terminal, use the command 'chown -R www-data:www-data /path/to/your/owncloud/install/data' "))); $tmpl->printPage(); |