Skip to content
Snippets Groups Projects
Commit 521294d0 authored by Thomas Müller's avatar Thomas Müller
Browse files
parent 790ae70e
Branches
No related tags found
No related merge requests found
...@@ -170,14 +170,18 @@ class OC_Config{ ...@@ -170,14 +170,18 @@ class OC_Config{
} }
$content .= ");\n?>\n"; $content .= ");\n?>\n";
$filename = OC::$SERVERROOT."/config/config.php";
// Write the file // Write the file
$result=@file_put_contents( OC::$SERVERROOT."/config/config.php", $content ); $result=@file_put_contents( $filename, $content );
if(!$result) { if(!$result) {
$tmpl = new OC_Template( '', 'error', 'guest' ); $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->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(); $tmpl->printPage();
exit; exit;
} }
// Prevent others not to read the config
@chmod($filename, 0640);
return true; return true;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment