From 09e9f34bb495b435e826bce8cf716258039d4642 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Feb 2021 10:22:27 +0300 Subject: add UserHelper::find_user_by_login() and rewrite some user checks to invoke it instead of going through PDO --- classes/handler/public.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'classes/handler/public.php') 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"; } -- cgit v1.2.3