mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-12 03:26:50 +01:00
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
This commit is contained in:
@@ -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}
|
||||
@@ -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";
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user