1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 03:35: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:
Andrew Dolgov
2021-02-11 10:22:27 +03:00
parent 7af8744c85
commit 09e9f34bb4
7 changed files with 51 additions and 82 deletions

View File

@@ -502,13 +502,10 @@
Debug::log("Exporting feeds of user $user to $filename as OPML...");
$sth = $pdo->prepare("SELECT id FROM ttrss_users WHERE LOWER(login) = LOWER(?)");
$sth->execute([$user]);
if ($res = $sth->fetch()) {
if ($owner_uid = UserHelper::find_user_by_login($user)) {
$opml = new OPML("");
$rc = $opml->opml_export($filename, $res["id"], false, true, true);
$rc = $opml->opml_export($filename, $owner_uid, false, true, true);
Debug::log($rc ? "Success." : "Failed.");
} else {