From: Andrew Dolgov Date: Fri, 18 Nov 2005 06:29:36 +0000 (+0100) Subject: optional SINGLE_USER_MODE X-Git-Tag: schema_feature_freeze_for_1.1~242 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7d4c898ab3adbfbb0ad2c6887afc391273762828;p=tt-rss.git optional SINGLE_USER_MODE --- diff --git a/backend.php b/backend.php index ed8ab6c1..edef18a0 100644 --- a/backend.php +++ b/backend.php @@ -1621,28 +1621,32 @@ } else { - print "
"; - - print ""; - print ""; - - print ""; - print ""; - - print ""; - - print ""; + if (!SINGLE_USER_MODE) { - print "

Authentication

Old password
New password
"; - - print ""; - - print "

"; + print ""; + + print ""; + print ""; + + print ""; + print ""; + + print ""; + + print ""; + + print "

Authentication

Old password
New password
"; + + print ""; + + print "

"; + + print "

"; - print ""; + } $result = db_query($link, "SELECT ttrss_user_prefs.pref_name,short_desc,help_text,value,type_name, diff --git a/config.php-dist b/config.php-dist index 8e34e7b2..9cea364d 100644 --- a/config.php-dist +++ b/config.php-dist @@ -16,5 +16,9 @@ define(USE_HTTP_AUTH, false); // use HTTP Basic authentication -?> + define(SINGLE_USER_MODE, true); + // disable all multi-user stuff altogether and just assume admin user + // is always logged in + +?> diff --git a/prefs.php b/prefs.php index 837cf584..f6b862f0 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 @@
+ Hello, (Logout) + diff --git a/tt-rss.php b/tt-rss.php index 9348944f..6dd4195f 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -8,13 +8,19 @@ $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"]); @@ -70,7 +76,9 @@
+ Hello, (Logout) +