Skip to content

Commit c6e1640

Browse files
committed
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.
1 parent 917a3c1 commit c6e1640

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/Ldap/Rules/LoginObjectclassRule.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ class LoginObjectclassRule implements Rule
1717
public function passes(LdapRecord $user,?Eloquent $model=NULL): bool
1818
{
1919
if ($x=config('pla.login.objectclass')) {
20-
return count(array_intersect($user->objectclass,$x));
20+
return count(array_intersect(
21+
array_map('strtolower',$user?->objectclass ?: []),
22+
array_map('strtolower',$x)
23+
));
2124

2225
// Otherwise allow the user to login
2326
} else {

0 commit comments

Comments
 (0)