mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
This commit is contained in:
parent
790ae70e32
commit
521294d0bf
1 changed files with 5 additions and 1 deletions
|
|
@ -170,14 +170,18 @@ class OC_Config{
|
|||
}
|
||||
$content .= ");\n?>\n";
|
||||
|
||||
$filename = OC::$SERVERROOT."/config/config.php";
|
||||
// Write the file
|
||||
$result=@file_put_contents( OC::$SERVERROOT."/config/config.php", $content );
|
||||
$result=@file_put_contents( $filename, $content );
|
||||
if(!$result) {
|
||||
$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;
|
||||
}
|
||||
// Prevent others not to read the config
|
||||
@chmod($filename, 0640);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue