X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=api%2Findex.php;h=3fbf6bf575e914e271080b3a850be667790d9d3f;hb=07fd4f8d9d4f301f5ad88ff9e80f042fc3eb0c36;hp=facdf82c54db587e9cd07f6cb826b6daec494555;hpb=a4fd183b5853867a9293dba438512d8400e6b65e;p=tt-rss.git diff --git a/api/index.php b/api/index.php index facdf82c..3fbf6bf5 100644 --- a/api/index.php +++ b/api/index.php @@ -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); @@ -53,8 +54,24 @@ @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(); -?> +