Fix for when the logged in user's details doesnt include an objectclass (because the query didnt have the ACLs to return them).
This should help #330 but doesnt allow the user to login even if they have the right objectclasses, but the query didnt return them.
This commit is contained in:
parent
917a3c1a0d
commit
c6e1640752
@ -17,7 +17,10 @@ class LoginObjectclassRule implements Rule
|
||||
public function passes(LdapRecord $user,?Eloquent $model=NULL): bool
|
||||
{
|
||||
if ($x=config('pla.login.objectclass')) {
|
||||
return count(array_intersect($user->objectclass,$x));
|
||||
return count(array_intersect(
|
||||
array_map('strtolower',$user?->objectclass ?: []),
|
||||
array_map('strtolower',$x)
|
||||
));
|
||||
|
||||
// Otherwise allow the user to login
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user