Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #114 from apility/feature/check_access-fix
Browse files Browse the repository at this point in the history
Check_access fix
  • Loading branch information
thomas-alrek committed Dec 3, 2019
2 parents 5feda37 + be0d2a4 commit 4898ebf
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/functions/live/functions_auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
}
}

0 comments on commit 4898ebf

Please sign in to comment.