Rename variable

This commit is contained in:
Alex Tselegidis 2023-10-09 09:56:40 +02:00
parent 3aba05bd28
commit cac3e6317d

View file

@ -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');
}