summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-02-07 16:25:37 +0300
committerAndrew Dolgov <[email protected]>2011-02-07 16:25:37 +0300
commitfbd40f5dd83a6c156e6b5bbbd39225a0a8fadb3e (patch)
tree46406bc988d39754afc2c32cc285708dc1d7c23e /api
parent4909f981ce3a7b4029abb41ccaf58c6e651b26b1 (diff)
api: default to admin username when logging in in single user mode (fixed)
Diffstat (limited to 'api')
-rw-r--r--api/index.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/index.php b/api/index.php
index babd50a07..e7aca9504 100644
--- a/api/index.php
+++ b/api/index.php
@@ -70,6 +70,8 @@
$password = db_escape_string($_REQUEST["password"]);
$password_base64 = db_escape_string(base64_decode($_REQUEST["password"]));
+ if (SINGLE_USER_MODE) $login = "admin";
+
$result = db_query($link, "SELECT id FROM ttrss_users WHERE login = '$login'");
if (db_num_rows($result) != 0) {
@@ -78,8 +80,6 @@
$uid = 0;
}
- if (SINGLE_USER_MODE) $login = "admin";
-
if ($uid && get_pref($link, "ENABLE_API_ACCESS", $uid)) {
if (authenticate_user($link, $login, $password)) { // try login with normal password
print api_wrap_reply(API_STATUS_OK, $seq,