]> git.wh0rd.org - tt-rss.git/blobdiff - api/index.php
support disabling of e-mail digests entirely
[tt-rss.git] / api / index.php
index facdf82c54db587e9cd07f6cb826b6daec494555..3fbf6bf575e914e271080b3a850be667790d9d3f 100644 (file)
@@ -19,6 +19,7 @@
        require_once "functions.php";
        require_once "sessions.php";
 
+       ini_set('session.use_cookies', 0);
        ini_set("session.gc_maxlifetime", 86400);
 
        define('AUTH_DISABLE_OTP', true);
                @session_start();
        }
 
+       startup_gettext();
+
        if (!init_plugins()) return;
 
+       if ($_SESSION["uid"]) {
+               if (!validate_session()) {
+                       header("Content-Type: text/json");
+
+                       print json_encode(array("seq" => -1,
+                               "status" => 1,
+                               "content" => array("error" => "NOT_LOGGED_IN")));
+
+                       return;
+               }
+
+               load_user_plugins( $_SESSION["uid"]);
+       }
+
        $method = strtolower($_REQUEST["op"]);
 
        $handler = new API($_REQUEST);
@@ -71,4 +88,4 @@
        header("Api-Content-Length: " . ob_get_length());
 
        ob_end_flush();
-?>
+