summaryrefslogtreecommitdiff
path: root/prefs.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-18 07:29:36 +0100
committerAndrew Dolgov <[email protected]>2005-11-18 07:29:36 +0100
commit7d4c898ab3adbfbb0ad2c6887afc391273762828 (patch)
treeceee8f3919ea21a66a7be2abad674212fec9b5cd /prefs.php
parentc8437f35c62f0ad12eee5d4b2ac075c44d7ed2c7 (diff)
optional SINGLE_USER_MODE
Diffstat (limited to 'prefs.php')
-rw-r--r--prefs.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/prefs.php b/prefs.php
index 837cf584f..f6b862f07 100644
--- a/prefs.php
+++ b/prefs.php
@@ -8,15 +8,22 @@
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
- if (!USE_HTTP_AUTH) {
- if (!$_SESSION["uid"]) {
- header("Location: login.php");
- exit;
+ if (!SINGLE_USER_MODE) {
+
+ if (!USE_HTTP_AUTH) {
+ if (!$_SESSION["uid"]) {
+ header("Location: login.php");
+ exit;
+ }
+ } else {
+ authenticate_user($link);
}
} else {
- authenticate_user($link);
+ $_SESSION["uid"] = 1;
+ $_SESSION["name"] = "admin";
}
+
initialize_user_prefs($link, $_SESSION["uid"]);
// FIXME this needs to be moved somewhere after user creation
@@ -61,7 +68,9 @@
<div id="notify"><span id="notify_body"></div>
</td>
</tr><tr><td class="welcomePrompt">
+ <? if (!SINGLE_USER_MODE) { ?>
Hello, <b><?= $_SESSION["name"] ?></b> (<a href="logout.php">Logout</a>)</td>
+ <? } ?>
</tr></table>
</td>
</tr>