]> git.wh0rd.org - tt-rss.git/blobdiff - backend.php
allow connections to pgsql without password
[tt-rss.git] / backend.php
index 7757931f3e38ccd75bc3ec58899fa24345fa548f..38af31c1c2f1de2c43ae5b3a3e2e38abf806a2d4 100644 (file)
@@ -6,7 +6,7 @@
        if (get_magic_quotes_gpc()) {
                $_REQUEST = array_map('stripslashes', $_REQUEST);
                $_POST = array_map('stripslashes', $_POST);
-               $_REQUEST = array_map('stripslashes', $_REQUEST);
+//             $_REQUEST = array_map('stripslashes', $_REQUEST);
                $_COOKIE = array_map('stripslashes', $_COOKIE);
        }
 
                1440 => __("Daily"),
                10080 => __("Weekly"));
 
+       $update_intervals_nodefault = array(
+               -1  => __("Disable updates"),
+               15  => __("Each 15 minutes"),
+               30  => __("Each 30 minutes"),
+               60  => __("Hourly"),
+               240 => __("Each 4 hours"),
+               720 => __("Each 12 hours"),
+               1440 => __("Daily"),
+               10080 => __("Weekly"));
+
        $update_methods = array(
                0   => __("Default"),
                1   => __("Magpie"),
                2   => __("SimplePie"));
 
-       if (ENABLE_SIMPLEPIE) {
+       if (DEFAULT_UPDATE_METHOD == "1") {
                $update_methods[0] .= ' (SimplePie)';
        } else {
                $update_methods[0] .= ' (Magpie)';
 
                case "getUnread":
                        $login = db_escape_string($_REQUEST["login"]);
+                       $fresh = $_REQUEST["fresh"] == "1";
 
                        header("Content-Type: text/plain; charset=utf-8");
 
 
                        if (db_num_rows($result) == 1) {
                                $uid = db_fetch_result($result, 0, "id");
+
                                print getGlobalUnread($link, $uid);
+
+                               if ($fresh) {
+                                       print ";";
+                                       print getFeedArticles($link, -3, false, true, $uid);
+                               }
+
                        } else {
                                print "-1;User not found";
                        }
                                print "</select>";
 
                                $_SESSION = array();
-
+                       }
                break;
-               }
 
        } // Select action according to $op value.