diff options
Diffstat (limited to 'api/index.php')
-rw-r--r-- | api/index.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/api/index.php b/api/index.php index ff8c70f58..90ca5405c 100644 --- a/api/index.php +++ b/api/index.php @@ -44,11 +44,10 @@ return; } -/* TODO: add pref key to disable/enable API - if ($_SESSION["uid"] && !get_pref($link, 'API_ENABLED')) { + if ($_SESSION["uid"] && $op != "logout" && !get_pref($link, 'ENABLE_API_ACCESS')) { print json_encode(array("error" => 'API_DISABLED')); return; - } */ + } switch ($op) { case "getVersion": @@ -62,7 +61,7 @@ if (authenticate_user($link, $login, $password)) { print json_encode(array("uid" => $_SESSION["uid"])); } else { - print json_encode(array("uid" => 0)); + print json_encode(array("error" => "LOGIN_ERROR")); } break; |