diff options
author | Andrew Dolgov <[email protected]> | 2021-02-11 10:22:27 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-11 10:22:27 +0300 |
commit | 09e9f34bb495b435e826bce8cf716258039d4642 (patch) | |
tree | 60cdaf053a0af182cc66002790548caf09339c25 /classes/handler/public.php | |
parent | 7af8744c856545f62a2f24fd1a700f40b90b8e37 (diff) |
add UserHelper::find_user_by_login() and rewrite some user checks to invoke it instead of going through PDO
Diffstat (limited to 'classes/handler/public.php')
-rwxr-xr-x | classes/handler/public.php | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php index a1ed667be..c6310f18b 100755 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -248,19 +248,15 @@ class Handler_Public extends Handler { $login = clean($_REQUEST["login"]); $fresh = clean($_REQUEST["fresh"]) == "1"; - $sth = $this->pdo->prepare("SELECT id FROM ttrss_users WHERE LOWER(login) = LOWER(?)"); - $sth->execute([$login]); - - if ($row = $sth->fetch()) { - $uid = $row["id"]; + $uid = UserHelper::find_user_by_login($login); + if ($uid) { print Feeds::getGlobalUnread($uid); if ($fresh) { print ";"; print Feeds::getFeedArticles(-3, false, true, $uid); } - } else { print "-1;User not found"; } |