]> git.wh0rd.org Git - tt-rss.git/commitdiff
api: return api_level with login
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 29 Sep 2012 07:59:50 +0000 (11:59 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 29 Sep 2012 07:59:50 +0000 (11:59 +0400)
classes/api.php

index 028cbf929a3d63204905b123b787c24278d237a4..744e67ce6d4f5020761920bd42c154f6bafd6ce3 100644 (file)
@@ -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"));
                        }