optional SINGLE_USER_MODE
This commit is contained in:
parent
c8437f35c6
commit
7d4c898ab3
|
@ -1621,6 +1621,8 @@
|
|||
|
||||
} else {
|
||||
|
||||
if (!SINGLE_USER_MODE) {
|
||||
|
||||
print "<form action=\"backend.php\" method=\"POST\">";
|
||||
|
||||
print "<table width=\"100%\" class=\"prefPrefsList\">";
|
||||
|
@ -1644,6 +1646,8 @@
|
|||
|
||||
print "</form>";
|
||||
|
||||
}
|
||||
|
||||
$result = db_query($link, "SELECT
|
||||
ttrss_user_prefs.pref_name,short_desc,help_text,value,type_name,
|
||||
section_name,def_value
|
||||
|
|
|
@ -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
|
||||
|
||||
?>
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||
|
||||
if (!SINGLE_USER_MODE) {
|
||||
|
||||
if (!USE_HTTP_AUTH) {
|
||||
if (!$_SESSION["uid"]) {
|
||||
header("Location: login.php");
|
||||
|
@ -16,6 +18,11 @@
|
|||
} else {
|
||||
authenticate_user($link);
|
||||
}
|
||||
} else {
|
||||
$_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>
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||
|
||||
if (!SINGLE_USER_MODE) {
|
||||
|
||||
if (!USE_HTTP_AUTH) {
|
||||
if (!$_SESSION["uid"]) {
|
||||
header("Location: login.php");
|
||||
|
@ -16,6 +18,10 @@
|
|||
} else {
|
||||
authenticate_user($link);
|
||||
}
|
||||
} else {
|
||||
$_SESSION["uid"] = 1;
|
||||
$_SESSION["name"] = "admin";
|
||||
}
|
||||
|
||||
initialize_user_prefs($link, $_SESSION["uid"]);
|
||||
// FIXME this needs to be moved somewhere after user creation
|
||||
|
@ -70,7 +76,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>
|
||||
|
|
Loading…
Reference in New Issue