mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 20:05:55 +00:00
add UserHelper::find_user_by_login() and rewrite some user checks to invoke it instead of going through PDO
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user