install.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install.php b/install.php index ac6c25e..1cf9f33 100644 --- a/install.php +++ b/install.php @@ -66,6 +66,7 @@ if ( empty($INSTALL['language']) and empty($_POST['language']) ) { $INSTALL['downloadlangpack'] = false; $INSTALL['showdownloadlangpack'] = true; $INSTALL['downloadlangpackerror'] = ''; + $INSTALL['directorypermissions'] = 00777; /// To be used by the Installer $INSTALL['wwwroot'] = ''; @@ -137,7 +138,7 @@ $CFG->dirroot = $INSTALL['dirroot']; $CFG->libdir = $INSTALL['dirroot'].'/lib'; $CFG->dataroot = $INSTALL['dataroot']; $CFG->admin = $INSTALL['admindirname']; -$CFG->directorypermissions = 00777; +$CFG->directorypermissions = $INSTALL['directorypermissions']; $CFG->running_installer = true; $CFG->docroot = 'http://docs.moodle.org'; $CFG->httpswwwroot = $INSTALL['wwwrootform']; // Needed by doc_link() in Server Checks page. @@ -552,7 +553,7 @@ if ($nextstage == SAVE) { $str .= '$CFG->admin = \''.s($INSTALL['admindirname'],true)."';\r\n"; $str .= "\r\n"; - $str .= '$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode'."\r\n"; + $str .= '$CFG->directorypermissions = '.sprintf("%05o",$INSTALL['directorypermissions']).'; // try 02777 on a server in Safe Mode'."\r\n"; $str .= "\r\n"; $str .= '$CFG->passwordsaltmain = \''.addsingleslashes(complex_random_string()).'\';'."\r\n";