api: default to admin username when logging in in single user mode (fixed)
This commit is contained in:
parent
4909f981ce
commit
fbd40f5dd8
1 changed files with 2 additions and 2 deletions
|
@ -70,6 +70,8 @@
|
||||||
$password = db_escape_string($_REQUEST["password"]);
|
$password = db_escape_string($_REQUEST["password"]);
|
||||||
$password_base64 = db_escape_string(base64_decode($_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'");
|
$result = db_query($link, "SELECT id FROM ttrss_users WHERE login = '$login'");
|
||||||
|
|
||||||
if (db_num_rows($result) != 0) {
|
if (db_num_rows($result) != 0) {
|
||||||
|
@ -78,8 +80,6 @@
|
||||||
$uid = 0;
|
$uid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SINGLE_USER_MODE) $login = "admin";
|
|
||||||
|
|
||||||
if ($uid && get_pref($link, "ENABLE_API_ACCESS", $uid)) {
|
if ($uid && get_pref($link, "ENABLE_API_ACCESS", $uid)) {
|
||||||
if (authenticate_user($link, $login, $password)) { // try login with normal password
|
if (authenticate_user($link, $login, $password)) { // try login with normal password
|
||||||
print api_wrap_reply(API_STATUS_OK, $seq,
|
print api_wrap_reply(API_STATUS_OK, $seq,
|
||||||
|
|
Loading…
Reference in a new issue