diff options
author | Andrew Dolgov <[email protected]> | 2016-07-20 13:55:51 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2016-07-20 13:55:51 +0300 |
commit | 4afcf635635c548bbad0a27b7c9c7d2b3804fc61 (patch) | |
tree | bfc0e38762ec1f16fb95a4907073c41e825733e0 /api/index.php | |
parent | 5d97019d5d30b259b84feba246eeb4ee08b42a99 (diff) |
api host: add session validation
Diffstat (limited to 'api/index.php')
-rw-r--r-- | api/index.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/api/index.php b/api/index.php index b02a5d679..d451a3ac8 100644 --- a/api/index.php +++ b/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"]); } |