Change true to false if checkbox is set

This commit is contained in:
Matt Pass
2016-04-14 09:28:05 +01:00
parent 09d34da6c3
commit 5a9cd5e85c

View File

@@ -260,6 +260,17 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
die("Couldn't create $settingsFileAddr. Maybe you need write permissions on the lib folder?");
}
}
// Disable the enableRegistration config setting if the user had that option chosen
if (isset($_POST['disableFurtherRegistration'])) {
$updatedConfigSettingsFile = file_get_contents(dirname(__FILE__)."/".$configSettings);
if ($fUConfigSettings = fopen(dirname(__FILE__)."/".$configSettings, 'w')) {
$updatedConfigSettingsFile = str_replace('"enableRegistration" => true','"enableRegistration" => false',$updatedConfigSettingsFile);
fwrite($fUConfigSettings, $updatedConfigSettingsFile);
fclose($fUConfigSettings);
} else {
die("Cannot update config file lib/".$configSettings.". Please check write permissions on lib/ and try again");
}
}
// Set the session user level
if ($ICEcoder["multiUser"]) {
$_SESSION['username']=$_POST['username'];