optional SINGLE_USER_MODE
This commit is contained in:
parent
c8437f35c6
commit
7d4c898ab3
32
backend.php
32
backend.php
|
@ -1621,28 +1621,32 @@
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
print "<form action=\"backend.php\" method=\"POST\">";
|
if (!SINGLE_USER_MODE) {
|
||||||
|
|
||||||
print "<table width=\"100%\" class=\"prefPrefsList\">";
|
print "<form action=\"backend.php\" method=\"POST\">";
|
||||||
print "<tr><td colspan='3'><h3>Authentication</h3></tr></td>";
|
|
||||||
|
|
||||||
print "<tr><td width=\"40%\">Old password</td>";
|
print "<table width=\"100%\" class=\"prefPrefsList\">";
|
||||||
print "<td><input class=\"editbox\" type=\"password\"
|
print "<tr><td colspan='3'><h3>Authentication</h3></tr></td>";
|
||||||
name=\"OLD_PASSWORD\"></td></tr>";
|
|
||||||
|
|
||||||
print "<tr><td width=\"40%\">New password</td>";
|
print "<tr><td width=\"40%\">Old password</td>";
|
||||||
|
print "<td><input class=\"editbox\" type=\"password\"
|
||||||
|
name=\"OLD_PASSWORD\"></td></tr>";
|
||||||
|
|
||||||
print "<td><input class=\"editbox\" type=\"password\"
|
print "<tr><td width=\"40%\">New password</td>";
|
||||||
name=\"NEW_PASSWORD\"></td></tr>";
|
|
||||||
|
|
||||||
print "</table>";
|
print "<td><input class=\"editbox\" type=\"password\"
|
||||||
|
name=\"NEW_PASSWORD\"></td></tr>";
|
||||||
|
|
||||||
print "<input type=\"hidden\" name=\"op\" value=\"pref-prefs\">";
|
print "</table>";
|
||||||
|
|
||||||
print "<p><input class=\"button\" type=\"submit\"
|
print "<input type=\"hidden\" name=\"op\" value=\"pref-prefs\">";
|
||||||
value=\"Change password\" name=\"subop\">";
|
|
||||||
|
|
||||||
print "</form>";
|
print "<p><input class=\"button\" type=\"submit\"
|
||||||
|
value=\"Change password\" name=\"subop\">";
|
||||||
|
|
||||||
|
print "</form>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$result = db_query($link, "SELECT
|
$result = db_query($link, "SELECT
|
||||||
ttrss_user_prefs.pref_name,short_desc,help_text,value,type_name,
|
ttrss_user_prefs.pref_name,short_desc,help_text,value,type_name,
|
||||||
|
|
|
@ -16,5 +16,9 @@
|
||||||
|
|
||||||
define(USE_HTTP_AUTH, false);
|
define(USE_HTTP_AUTH, false);
|
||||||
// use HTTP Basic authentication
|
// use HTTP Basic authentication
|
||||||
?>
|
|
||||||
|
|
||||||
|
define(SINGLE_USER_MODE, true);
|
||||||
|
// disable all multi-user stuff altogether and just assume admin user
|
||||||
|
// is always logged in
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
19
prefs.php
19
prefs.php
|
@ -8,15 +8,22 @@
|
||||||
|
|
||||||
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||||
|
|
||||||
if (!USE_HTTP_AUTH) {
|
if (!SINGLE_USER_MODE) {
|
||||||
if (!$_SESSION["uid"]) {
|
|
||||||
header("Location: login.php");
|
if (!USE_HTTP_AUTH) {
|
||||||
exit;
|
if (!$_SESSION["uid"]) {
|
||||||
|
header("Location: login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
authenticate_user($link);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
authenticate_user($link);
|
$_SESSION["uid"] = 1;
|
||||||
|
$_SESSION["name"] = "admin";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
initialize_user_prefs($link, $_SESSION["uid"]);
|
initialize_user_prefs($link, $_SESSION["uid"]);
|
||||||
// FIXME this needs to be moved somewhere after user creation
|
// FIXME this needs to be moved somewhere after user creation
|
||||||
|
|
||||||
|
@ -61,7 +68,9 @@
|
||||||
<div id="notify"><span id="notify_body"></div>
|
<div id="notify"><span id="notify_body"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr><td class="welcomePrompt">
|
</tr><tr><td class="welcomePrompt">
|
||||||
|
<? if (!SINGLE_USER_MODE) { ?>
|
||||||
Hello, <b><?= $_SESSION["name"] ?></b> (<a href="logout.php">Logout</a>)</td>
|
Hello, <b><?= $_SESSION["name"] ?></b> (<a href="logout.php">Logout</a>)</td>
|
||||||
|
<? } ?>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
18
tt-rss.php
18
tt-rss.php
|
@ -8,13 +8,19 @@
|
||||||
|
|
||||||
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||||
|
|
||||||
if (!USE_HTTP_AUTH) {
|
if (!SINGLE_USER_MODE) {
|
||||||
if (!$_SESSION["uid"]) {
|
|
||||||
header("Location: login.php");
|
if (!USE_HTTP_AUTH) {
|
||||||
exit;
|
if (!$_SESSION["uid"]) {
|
||||||
|
header("Location: login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
authenticate_user($link);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
authenticate_user($link);
|
$_SESSION["uid"] = 1;
|
||||||
|
$_SESSION["name"] = "admin";
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize_user_prefs($link, $_SESSION["uid"]);
|
initialize_user_prefs($link, $_SESSION["uid"]);
|
||||||
|
@ -70,7 +76,9 @@
|
||||||
<div id="notify"><span id="notify_body"></div>
|
<div id="notify"><span id="notify_body"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr><td class="welcomePrompt">
|
</tr><tr><td class="welcomePrompt">
|
||||||
|
<? if (!SINGLE_USER_MODE) { ?>
|
||||||
Hello, <b><?= $_SESSION["name"] ?></b> (<a href="logout.php">Logout</a>)</td>
|
Hello, <b><?= $_SESSION["name"] ?></b> (<a href="logout.php">Logout</a>)</td>
|
||||||
|
<? } ?>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue