]> git.wh0rd.org - tt-rss.git/blobdiff - classes/handler/public.php
generate_syndicated_feed: add support for virtual feeds provided by plugins
[tt-rss.git] / classes / handler / public.php
index 38a8d749b91179f8e0b4a6cb49e33cb87ad9a4c2..dbed3fee6f6b2e578a3f27b7713ba426914c4e2d 100755 (executable)
@@ -33,6 +33,7 @@ class Handler_Public extends Handler {
                        $date_sort_field = "updated DESC";
                        break;
                }
+
                $params = array(
                        "owner_uid" => $owner_uid,
                        "feed" => $feed,
@@ -47,7 +48,26 @@ class Handler_Public extends Handler {
                        "start_ts" => $start_ts
                );
 
-               $qfh_ret = Feeds::queryFeedHeadlines($params);
+               if (!$is_cat && is_numeric($feed) && $feed < PLUGIN_FEED_BASE_INDEX && $feed > LABEL_BASE_INDEX) {
+
+                       $user_plugins = get_pref("_ENABLED_PLUGINS", $owner_uid);
+
+                       $tmppluginhost = new PluginHost();
+                       $tmppluginhost->load(PLUGINS, PluginHost::KIND_ALL);
+                       $tmppluginhost->load($user_plugins, PluginHost::KIND_USER, $owner_uid);
+                       $tmppluginhost->load_data();
+
+                       $handler = $tmppluginhost->get_feed_handler(
+                               PluginHost::feed_to_pfeed_id($feed));
+
+                       if ($handler) {
+                               $qfh_ret = $handler->get_headlines(PluginHost::feed_to_pfeed_id($feed),
+                                       $options);
+                       }
+
+               } else {
+                       $qfh_ret = Feeds::queryFeedHeadlines($params);
+               }
 
                $result = $qfh_ret[0];
                $feed_title = htmlspecialchars($qfh_ret[1]);
@@ -465,14 +485,6 @@ class Handler_Public extends Handler {
 
        function login() {
                if (!SINGLE_USER_MODE) {
-                       /* if a session is started here there's a stale login cookie we need to clean */
-
-                       if (session_status() != PHP_SESSION_NONE) {
-                               $_SESSION["login_error_msg"] = __("Stale session cookie found, try logging in again");
-
-                               header("Location: " . get_self_url_prefix());
-                               exit;
-                       }
 
                        $login = clean($_POST["login"]);
                        $password = clean($_POST["password"]);