From aa2ed93d743d63580d32851005bd567f89c2ad6a Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Tue, 4 Jun 2013 18:03:32 +0100 Subject: [PATCH] Load system and user settings files $configSettings is a seperate file now, containing the array of settings we have buried in this file Renamed user template, so change of filename here Also using $configUsersTemplate to be clearer about things --- lib/settings.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/settings.php b/lib/settings.php index d508938..3d56865 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -80,30 +80,27 @@ function toUTF8noBOM($string,$message) { return $string; } +// Load system settings +$configSettings = 'config___settings.php'; +include(dirname(__FILE__)."/".$configSettings); + // Settings are stored in this file -$settingsTemplate = 'config___template.php'; +$configUsersTemplate = 'config___users-template.php'; $username = ""; if (isset($_POST['username']) && $_POST['username'] != "") {$username = strClean($_POST['username']."-");}; if (isset($_SESSION['username']) && $_SESSION['username'] != "") {$username = strClean($_SESSION['username']."-");}; $settingsFile = 'config-'.$username.str_replace(".","_",$_SERVER['SERVER_NAME']).'.php'; $setPWorLogin = "login"; if (!file_exists(dirname(__FILE__)."/".$settingsFile)) { - if (!copy(dirname(__FILE__)."/".$settingsTemplate, dirname(__FILE__)."/".$settingsFile)) { + if (!copy(dirname(__FILE__)."/".$configUsersTemplate, dirname(__FILE__)."/".$settingsFile)) { die("Couldn't create $settingsFile. Maybe you need write permissions on the lib folder?"); } $setPWorLogin = "set password"; } include(dirname(__FILE__)."/".$settingsFile); -// Add ICEcoder settings to beginning of $ICEcoder array -$ICEcoder = array( - "versionNo" => "2.5", - "codeMirrorDir" => "CodeMirror-3.13", - "demoMode" => false, - "devMode" => false, - "multiUser" => false, - "lineEnding" => "\n" -)+$ICEcoder; +// Join ICEcoder settings and user settings together to make our final ICEcoder array +$ICEcoder = $ICEcoderSettings + $ICEcoderUserSettings; $onLoadExtras = ""; $pluginsDisplay = "";