1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 17:45:55 +00:00

api: forbid login when api is disabled

This commit is contained in:
Andrew Dolgov
2009-12-16 14:49:33 +03:00
parent 3a216db45c
commit 4cdd0d7ca3

View File

@@ -58,11 +58,16 @@
$login = db_escape_string($_REQUEST["user"]);
$password = db_escape_string($_REQUEST["password"]);
if (get_pref($link, "ENABLE_API_ACCESS", $login)) {
if (authenticate_user($link, $login, $password)) {
print json_encode(array("uid" => $_SESSION["uid"]));
} else {
print json_encode(array("error" => "LOGIN_ERROR"));
}
} else {
logout_user();
print json_encode(array("error" => "API_DISABLED"));
}
break;
case "logout":