From d3737f5a628dd51de54f46f6fdc066e1bb954dc6 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 15 Jun 2013 13:40:56 +0100 Subject: [PATCH] User settings carry version no & clear on upgrade versionNo also added to user settings array Check this against system and on mismatch, rename .old and reload to create new settings file --- lib/config___users-template.php | 1 + lib/settings.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/config___users-template.php b/lib/config___users-template.php index 2f49869..ea881dd 100644 --- a/lib/config___users-template.php +++ b/lib/config___users-template.php @@ -1,5 +1,6 @@ "3.0 beta", "root" => "", "checkUpdates" => true, "openLastFiles" => true, diff --git a/lib/settings.php b/lib/settings.php index f9c5915..0a4beed 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -101,6 +101,12 @@ if (!file_exists(dirname(__FILE__)."/".$settingsFile)) { } include(dirname(__FILE__)."/".$settingsFile); +// On mismatch of settings file to system, rename to .old and reload +If ($ICEcoderUserSettings["versionNo"] != $ICEcoderSettings["versionNo"]) { + rename(dirname(__FILE__)."/".$settingsFile,dirname(__FILE__)."/".str_replace(".php",".old",$settingsFile)); + header("Location: settings.php"); +} + // Join ICEcoder settings and user settings together to make our final ICEcoder array $ICEcoder = $ICEcoderSettings + $ICEcoderUserSettings;