summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-01-13 18:31:51 +0300
committerAndrew Dolgov <[email protected]>2010-01-13 18:31:51 +0300
commitd9084cf22059f709e935c6c0755d2b69c21b3a87 (patch)
tree546788700196fbeb06afc2e87aa837a51e16a905 /backend.php
parent57c7aa0f335d1cfef65646c958b838fd69a9ba5d (diff)
implement settings profiles (bump schema)
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/backend.php b/backend.php
index f1b9cd343..7757931f3 100644
--- a/backend.php
+++ b/backend.php
@@ -49,6 +49,7 @@
init_connection($link);
$op = $_REQUEST["op"];
+ $subop = $_REQUEST["subop"];
$mode = $_REQUEST["mode"];
$print_exec_time = false;
@@ -81,7 +82,7 @@
}
if (!($_SESSION["uid"] && validate_session($link)) && $op != "globalUpdateFeeds"
- && $op != "rss" && $op != "getUnread" && $op != "publish") {
+ && $op != "rss" && $op != "getUnread" && $op != "publish" && $op != "getProfiles") {
if ($op == "rpc" || $op == "viewfeed" || $op == "view") {
print_error_xml(6); die;
@@ -506,6 +507,32 @@
$print_exec_time = false;
break; // digestSend
+ case "getProfiles":
+ $login = db_escape_string($_REQUEST["login"]);
+ $password = db_escape_string($_REQUEST["password"]);
+
+ if (authenticate_user($link, $login, $password)) {
+ $result = db_query($link, "SELECT * FROM ttrss_settings_profiles
+ WHERE owner_uid = " . $_SESSION["uid"] . " ORDER BY title");
+
+ print "<select style='width: 100%' name='profile'>";
+
+ print "<option value='0'>" . __("Default profile") . "</option>";
+
+ while ($line = db_fetch_assoc($result)) {
+ $id = $line["id"];
+ $title = $line["title"];
+
+ print "<option value='$id'>$title</option>";
+ }
+
+ print "</select>";
+
+ $_SESSION = array();
+
+ break;
+ }
+
} // Select action according to $op value.
// We close the connection to database.