diff options
Diffstat (limited to 'classes')
-rwxr-xr-x | classes/handler/public.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php index 531392c84..e216d7a36 100755 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -262,23 +262,24 @@ class Handler_Public extends Handler { function getProfiles() { $login = clean($_REQUEST["login"]); + $rv = []; - $sth = $this->pdo->prepare("SELECT ttrss_settings_profiles.* FROM ttrss_settings_profiles,ttrss_users + if ($login) { + $sth = $this->pdo->prepare("SELECT ttrss_settings_profiles.* FROM ttrss_settings_profiles,ttrss_users WHERE ttrss_users.id = ttrss_settings_profiles.owner_uid AND login = ? ORDER BY title"); - $sth->execute([$login]); - - print "<select dojoType='dijit.form.Select' style='width : 220px; margin : 0px' name='profile'>"; + $sth->execute([$login]); - print "<option value='0'>" . __("Default profile") . "</option>"; + $rv = [ [ "value" => 0, "label" => __("Default profile") ] ]; - while ($line = $sth->fetch()) { - $id = $line["id"]; - $title = $line["title"]; + while ($line = $sth->fetch()) { + $id = $line["id"]; + $title = $line["title"]; - print "<option value='$id'>$title</option>"; - } + array_push($rv, [ "label" => $title, "value" => $id ]); + } + } - print "</select>"; + print json_encode($rv); } function logout() { |