1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-26 21:27:10 +00:00

use orm for app password stuff

This commit is contained in:
Andrew Dolgov
2021-03-02 08:08:48 +03:00
parent 372e8e062c
commit f56a4eab17
3 changed files with 29 additions and 27 deletions

View File

@@ -8,14 +8,12 @@ class Pref_Labels extends Handler_Protected {
}
function edit() {
$label_id = clean($_REQUEST['id']);
$label = ORM::for_table('ttrss_labels2')
->where('owner_uid', $_SESSION['uid'])
->find_one($_REQUEST['id']);
$sth = $this->pdo->prepare("SELECT id, caption, fg_color, bg_color FROM ttrss_labels2 WHERE
id = ? AND owner_uid = ?");
$sth->execute([$label_id, $_SESSION['uid']]);
if ($line = $sth->fetch(PDO::FETCH_ASSOC)) {
print json_encode($line);
if ($label) {
print json_encode($label->as_array());
}
}