diff --git a/lib/updater.php b/lib/updater.php
index 95d54bf..5595a27 100644
--- a/lib/updater.php
+++ b/lib/updater.php
@@ -112,8 +112,6 @@ function openZipNew($icvInfo) {
}
function copyOverSettings($icvInfo) {
- global $updateDone;
-
echo 'Getting old and new settings...
';
// Get old and new settings and start a new $contents
$oldSettingsContent = file_get_contents(PATH."lib/config___settings.php",false,$context);
@@ -131,7 +129,7 @@ function copyOverSettings($icvInfo) {
$contentLine = $newSettingsArray[$i].PHP_EOL;
for ($j=0; $j -1) {
+ if ($thisKey != "" && $thisKey != "versionNo" && $thisKey != "codeMirrorDir" && strpos($oldSettingsArray[$j],'"'.$thisKey.'"') > -1) {
$contentLine = $oldSettingsArray[$j].PHP_EOL;
}
}
@@ -142,6 +140,74 @@ function copyOverSettings($icvInfo) {
fwrite($fh, $contents);
fclose($fh);
+ echo 'Finished copying over settings...
';
+ copyOverUsersTemplate($icvInfo);
+}
+
+function copyOverUsersTemplate($icvInfo) {
+ echo 'Getting old and new users template...
';
+ // Get old and new users template and start a new $contents
+ $oldSettingsContent = file_get_contents(PATH."lib/config___users-template.php",false,$context);
+ $oldSettingsArray = explode("\n",$oldSettingsContent);
+ $newSettingsContent = file_get_contents("config___users-template.php",false,$context);
+ $newSettingsArray = explode("\n",$newSettingsContent);
+ $contents = "";
+
+ echo 'Transposing old users template to new users template...
';
+ // Now need to copy the old users template over to new users template...
+ for ($i=0; $i -1) {
+ $contentLine = $oldSettingsArray[$j].PHP_EOL;
+ }
+ }
+ $contents .= $contentLine;
+ }
+ echo 'Saving old users template to new ICEcoder users template file...
';
+ $fh = fopen('config___users-template.php', 'w') or die("Sorry, cannot update the new ICEcoder users template file");
+ fwrite($fh, $contents);
+ fclose($fh);
+
+ echo 'Finished copying over users template...
';
+ copyOverUserSettings($icvInfo);
+}
+
+function copyOverUserSettings($icvInfo) {
+ global $updateDone;
+
+ echo 'Getting old and new users settings...
';
+ // Get old and new users settings and start a new $contents
+ $oldSettingsContent = file_get_contents(PATH."lib/config-localhost.php",false,$context);
+ $oldSettingsArray = explode("\n",$oldSettingsContent);
+ $newSettingsContent = file_get_contents("config___users-template.php",false,$context);
+ $newSettingsArray = explode("\n",$newSettingsContent);
+ $contents = "";
+
+ echo 'Transposing old users settings to new users settings...
';
+ // Now need to copy the old users settings over to new users settings...
+ for ($i=0; $i -1) {
+ $contentLine = $oldSettingsArray[$j].PHP_EOL;
+ }
+ }
+ $contents .= $contentLine;
+ }
+ echo 'Saving old users settings to new ICEcoder users settings file...
';
+ $fh = fopen('config-localhost.php', 'w') or die("Sorry, cannot add the new ICEcoder users settings file");
+ fwrite($fh, $contents);
+ fclose($fh);
+
echo 'All update tasks completed...
';
$updateDone = true;
}