From 7111a2aee35ac98d878b6386ccd6a977b8806b95 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 23 Mar 2013 16:28:11 +0000 Subject: [PATCH] Check for updates setting on setup screen Checkbox added below password box on setup screen so users can choose not to check for updates before even setting up --- lib/ice-coder.css | 2 ++ lib/settings.php | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/ice-coder.css b/lib/ice-coder.css index 92c0307..0773b08 100644 --- a/lib/ice-coder.css +++ b/lib/ice-coder.css @@ -164,6 +164,8 @@ h2 {font-size: 18px; font-weight: normal; color: #fff} .screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center} .screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline} .screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb} +.screenCenter .text {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888} +.screenCenter .text input {margin-top: 1px} .screenCenter .accountPassword {border: 0; background-color: #333; color: #fff; height: 20px} .screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer} .screenCenter .button:hover {background: #2187e7; color: #eee} \ No newline at end of file diff --git a/lib/settings.php b/lib/settings.php index d3c2395..00701a0 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -261,6 +261,11 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["accountPassword"] == "") && !strpos($_ $settingsContents = file_get_contents($settingsFile); // Replace our empty password with the one submitted by user $settingsContents = str_replace('"accountPassword" => "",','"accountPassword" => "'.$password.'",',$settingsContents); + // Also set the update checker preference + $checkUpdates = $_POST['checkUpdates']=="true" ? "true" : "false"; + // once to cover the true setting, once to cover false + $settingsContents = str_replace('"checkUpdates" => true,','"checkUpdates" => '.$checkUpdates.',',$settingsContents); + $settingsContents = str_replace('"checkUpdates" => false,','"checkUpdates" => '.$checkUpdates.',',$settingsContents); // Now update the config file $fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on ".$settingsFile." and press refresh"); fwrite($fh, $settingsContents); @@ -295,6 +300,11 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
Password" class="accountPassword">

" class="button"> + auto-check for updates'; + } + ?>