From c96172fa044d847fee237d966a6e75f8be5afa4d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 25 Feb 2021 14:49:58 +0300 Subject: use constants in get_pref()/set_pref() --- classes/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes/api.php') 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)); -- cgit v1.2.3