summaryrefslogtreecommitdiff
path: root/api/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'api/index.php')
-rw-r--r--api/index.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/api/index.php b/api/index.php
index a8484ef0e..d451a3ac8 100644
--- a/api/index.php
+++ b/api/index.php
@@ -57,6 +57,20 @@
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);