Permalink
Browse files

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
  • Loading branch information...
1 parent cc82304 commit 7111a2aee35ac98d878b6386ccd6a977b8806b95 @mattpass committed Mar 23, 2013
Showing with 12 additions and 0 deletions.
  1. +2 −0 lib/ice-coder.css
  2. +10 −0 lib/settings.php
View
@@ -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}
View
@@ -261,6 +261,11 @@ function numClean($var) {
$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 @@ function numClean($var) {
<form name="settingsUpdate" action="settings.php" method="POST">
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword"><br><br>
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "set password" : "login"; ?>" class="button">
+ <?php
+ if ($ICEcoder["accountPassword"] == "") {
+ echo '<div class="text"><input type="checkbox" name="checkUpdates" value="true" checked> auto-check for updates</div>';
+ }
+ ?>
</form>
</div>
</div>

0 comments on commit 7111a2a

Please sign in to comment.