summaryrefslogtreecommitdiff
path: root/classes/api.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-25 14:49:58 +0300
committerAndrew Dolgov <[email protected]>2021-02-25 14:49:58 +0300
commitc96172fa044d847fee237d966a6e75f8be5afa4d (patch)
treecdd79fdea548ab41b642fca12be7634ad8d25d2d /classes/api.php
parent5aa05c90e1b979a2dd8985c10a541243e9415c39 (diff)
use constants in get_pref()/set_pref()
Diffstat (limited to 'classes/api.php')
-rwxr-xr-xclasses/api.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/api.php b/classes/api.php
index 18f9c83b5..7ca8ec8ba 100755
--- a/classes/api.php
+++ b/classes/api.php
@@ -36,7 +36,7 @@ class API extends Handler {
return false;
}
- if (!empty($_SESSION["uid"]) && $method != "logout" && !get_pref('ENABLE_API_ACCESS')) {
+ if (!empty($_SESSION["uid"]) && $method != "logout" && !get_pref(Prefs::ENABLE_API_ACCESS)) {
$this->_wrap(self::STATUS_ERR, array("error" => self::E_API_DISABLED));
return false;
}
@@ -69,7 +69,7 @@ class API extends Handler {
if (Config::get(Config::SINGLE_USER_MODE)) $login = "admin";
if ($uid = UserHelper::find_user_by_login($login)) {
- if (get_pref("ENABLE_API_ACCESS", $uid)) {
+ if (get_pref(Prefs::ENABLE_API_ACCESS, $uid)) {
if (UserHelper::authenticate($login, $password, false, Auth_Base::AUTH_SERVICE_API)) { // try login with normal password
$this->_wrap(self::STATUS_OK, array("session_id" => session_id(),
"api_level" => self::API_LEVEL));