From 5a9cd5e85c8c884e232175215904533fc79a3ab1 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 14 Apr 2016 09:28:05 +0100 Subject: [PATCH] Change true to false if checkbox is set --- lib/settings.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/settings.php b/lib/settings.php index 87ed706..9b415ea 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -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'];