summaryrefslogtreecommitdiff
path: root/classes/handler
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-04 23:17:35 +0300
committerAndrew Dolgov <[email protected]>2018-12-04 23:17:35 +0300
commit29c890b495d7ecd10ec9e7a61502fab9f8d4de0b (patch)
tree8229b49e0f57d38dc80fa264b135ed53d93effb2 /classes/handler
parenta1407b35e470829f96432328c84d6bb0334995c7 (diff)
login form: use dojo, remove profile hacks
Diffstat (limited to 'classes/handler')
-rwxr-xr-xclasses/handler/public.php23
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() {