summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-09-29 11:59:50 +0400
committerAndrew Dolgov <[email protected]>2012-09-29 11:59:50 +0400
commit5ba4ebc65e13ef78f1f7b0528681195d0fd88476 (patch)
tree39bfe218065f569c9db3da8fdf1bfc3408c01e58 /classes
parent07b63daf73e5dc239271501c68ce20b78fcab9a3 (diff)
api: return api_level with login
Diffstat (limited to 'classes')
-rw-r--r--classes/api.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/classes/api.php b/classes/api.php
index 028cbf929..744e67ce6 100644
--- a/classes/api.php
+++ b/classes/api.php
@@ -68,9 +68,11 @@ class API extends Handler {
if (get_pref($this->link, "ENABLE_API_ACCESS", $uid)) {
if (authenticate_user($this->link, $login, $password)) { // try login with normal password
- print $this->wrap(self::STATUS_OK, array("session_id" => session_id()));
+ print $this->wrap(self::STATUS_OK, array("session_id" => session_id(),
+ "api_level" => self::API_LEVEL));
} else if (authenticate_user($this->link, $login, $password_base64)) { // else try with base64_decoded password
- print $this->wrap(self::STATUS_OK, array("session_id" => session_id()));
+ print $this->wrap(self::STATUS_OK, array("session_id" => session_id(),
+ "api_level" => self::API_LEVEL));
} else { // else we are not logged in
print $this->wrap(self::STATUS_ERR, array("error" => "LOGIN_ERROR"));
}