From 92c983715718a6a4a06b7e953cbdf87f0094af0f Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 12 Aug 2018 13:28:40 +0100 Subject: [PATCH] Fixed incorrect type error in LDAP group sync Should fix #951 --- app/Http/Controllers/Auth/LoginController.php | 1 + app/Services/LdapService.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index e011c642f..791c265ad 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -70,6 +70,7 @@ class LoginController extends Controller * @param Authenticatable $user * @return \Illuminate\Http\RedirectResponse * @throws AuthException + * @throws \BookStack\Exceptions\LdapException */ protected function authenticated(Request $request, Authenticatable $user) { diff --git a/app/Services/LdapService.php b/app/Services/LdapService.php index 4936b2da8..c11094aa9 100644 --- a/app/Services/LdapService.php +++ b/app/Services/LdapService.php @@ -202,7 +202,7 @@ class LdapService /** * Get the groups a user is a part of on ldap * @param string $userName - * @return array|null + * @return array * @throws LdapException */ public function getUserGroups($userName) @@ -211,7 +211,7 @@ class LdapService $user = $this->getUserWithAttributes($userName, [$groupsAttr]); if ($user === null) { - return null; + return []; } $userGroups = $this->groupFilter($user);