From cac3e6317d76d38d143aaeec6dd4aeaf2b7a82e1 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 9 Oct 2023 09:56:40 +0200 Subject: [PATCH] Rename variable --- application/libraries/Api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/Api.php b/application/libraries/Api.php index eaf2fff6..44df3c71 100644 --- a/application/libraries/Api.php +++ b/application/libraries/Api.php @@ -79,9 +79,9 @@ class Api { $password = $_SERVER['PHP_AUTH_PW'] ?? NULL; - $userdata = $this->CI->accounts->check_login($username, $password); + $user_data = $this->CI->accounts->check_login($username, $password); - if (empty($userdata['role_slug']) || $userdata['role_slug'] !== DB_SLUG_ADMIN) + if (empty($user_data['role_slug']) || $user_data['role_slug'] !== DB_SLUG_ADMIN) { throw new RuntimeException('The provided credentials do not match any admin user!', 401, 'Unauthorized'); }