浏览代码

api host: add session validation

Andrew Dolgov 7 年之前
父节点
当前提交
4afcf63563
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      api/index.php

+ 10 - 0
api/index.php

@@ -58,6 +58,16 @@
 	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"]);
 	}