Fixed incorrect type error in LDAP group sync

Should fix #951
This commit is contained in:
Dan Brown 2018-08-12 13:28:40 +01:00
parent c860645a5a
commit 92c9837157
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 3 additions and 2 deletions

View File

@ -70,6 +70,7 @@ class LoginController extends Controller
* @param Authenticatable $user * @param Authenticatable $user
* @return \Illuminate\Http\RedirectResponse * @return \Illuminate\Http\RedirectResponse
* @throws AuthException * @throws AuthException
* @throws \BookStack\Exceptions\LdapException
*/ */
protected function authenticated(Request $request, Authenticatable $user) protected function authenticated(Request $request, Authenticatable $user)
{ {

View File

@ -202,7 +202,7 @@ class LdapService
/** /**
* Get the groups a user is a part of on ldap * Get the groups a user is a part of on ldap
* @param string $userName * @param string $userName
* @return array|null * @return array
* @throws LdapException * @throws LdapException
*/ */
public function getUserGroups($userName) public function getUserGroups($userName)
@ -211,7 +211,7 @@ class LdapService
$user = $this->getUserWithAttributes($userName, [$groupsAttr]); $user = $this->getUserWithAttributes($userName, [$groupsAttr]);
if ($user === null) { if ($user === null) {
return null; return [];
} }
$userGroups = $this->groupFilter($user); $userGroups = $this->groupFilter($user);