Example #1
0
 function catchall($method)
 {
     $plugin = PluginHost::getInstance()->get_plugin($_REQUEST["plugin"]);
     if ($plugin) {
         if (method_exists($plugin, $method)) {
             $plugin->{$method}();
         } else {
             print error_json(13);
         }
     } else {
         print error_json(14);
     }
 }
Example #2
0
        $handler = $override;
    } else {
        $handler = new $op($_REQUEST);
    }
    if ($handler && implements_interface($handler, 'IHandler')) {
        if (validate_csrf($csrf_token) || $handler->csrf_ignore($method)) {
            if ($handler->before($method)) {
                if ($method && method_exists($handler, $method)) {
                    $handler->{$method}();
                } else {
                    if (method_exists($handler, "catchall")) {
                        $handler->catchall($method);
                    }
                }
                $handler->after();
                return;
            } else {
                header("Content-Type: text/json");
                print error_json(6);
                return;
            }
        } else {
            header("Content-Type: text/json");
            print error_json(6);
            return;
        }
    }
}
header("Content-Type: text/json");
print error_json(13);
Example #3
0
 function index()
 {
     header("Content-Type: text/plain");
     print error_json(13);
 }
Example #4
0
 function fbexport()
 {
     $access_key = db_escape_string($_POST["key"]);
     // TODO: rate limit checking using last_connected
     $result = db_query("SELECT id FROM ttrss_linked_instances\n\t\t\tWHERE access_key = '{$access_key}'");
     if (db_num_rows($result) == 1) {
         $instance_id = db_fetch_result($result, 0, "id");
         $result = db_query("SELECT feed_url, site_url, title, subscribers\n\t\t\t\tFROM ttrss_feedbrowser_cache ORDER BY subscribers DESC LIMIT 100");
         $feeds = array();
         while ($line = db_fetch_assoc($result)) {
             array_push($feeds, $line);
         }
         db_query("UPDATE ttrss_linked_instances SET\n\t\t\t\tlast_status_in = 1 WHERE id = '{$instance_id}'");
         print json_encode(array("feeds" => $feeds));
     } else {
         print error_json(6);
     }
 }