From be0d2a4a19dd150865b3ff5358c801c7efb434d8 Mon Sep 17 00:00:00 2001 From: Cathrine Vaage Date: Tue, 3 Dec 2019 14:01:21 +0100 Subject: [PATCH] Refactors check_access return types Removes 2 as return value. Changes return types to boolean. --- src/functions/live/functions_auth.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/functions/live/functions_auth.php b/src/functions/live/functions_auth.php index d26ba2d..45aa7ab 100644 --- a/src/functions/live/functions_auth.php +++ b/src/functions/live/functions_auth.php @@ -50,7 +50,7 @@ function check_login($username, $password, $groups = '99999', $field = 'mail') * * @param string $username = null * @param string $groups = null - * @return int + * @return boolean */ function check_access($username = null, $groups = null) { @@ -63,18 +63,14 @@ function check_access($username = null, $groups = null) ); if (isset($customer['id']) && $groups == '99999') { - return 1; + return true; } if (isset($customer['id']) && in_array($groups, $customer['groups'])) { - return 1; - } - - if (isset($customer['id'])) { - return 2; + return true; } } catch (Exception $e) {} - return 0; + return false; } }