Begin setting up multiUser

For now tho this is hidden from view until the rest is set up
This commit is contained in:
Matt Pass
2013-05-28 19:07:51 +01:00
parent 7c2d6f6fb5
commit 33a354688a
2 changed files with 5 additions and 0 deletions

View File

@@ -170,6 +170,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
.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 .text a {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888; text-decoration: none}
.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 File

@@ -21,6 +21,7 @@ if(!isset($_SESSION)) {session_start();}
// Logout if that's the action we're taking
if (isset($_GET['logout'])) {
$_SESSION['loggedIn']=false;
$_SESSION['accountUsername']=false;
session_destroy();
header("Location: dirname(__FILE__)./?loggedOut");
}
@@ -94,6 +95,7 @@ $ICEcoder = array(
"codeMirrorDir" => "CodeMirror-3.13",
"demoMode" => false,
"devMode" => false,
"multiUser" => false,
"lineEnding" => "\n"
)+$ICEcoder;
@@ -341,12 +343,14 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
<img src="../images/ice-coder.png">
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
<form name="settingsUpdate" action="settings.php" method="POST">
<?php if ($ICEcoder["multiUser"]) { echo '<input type="text" name="'.($ICEcoder["accountPassword"] == "" ? "account" : "login").'Username" class="accountPassword"><br><br>';};?>
<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>';
}
if (!$ICEcoder["multiUser"] && 1==2) { echo '<div class="text"><a href="javascript:alert(\'To put into multi-user mode, open lib/settings.php and change multiUser to true then reload this page\')">multi-user?</a></div>';};
?>
</form>
</div>