diff --git a/app/Auth/Access/Guards/LdapSessionGuard.php b/app/Auth/Access/Guards/LdapSessionGuard.php index 18d4c289d..e7ed22704 100644 --- a/app/Auth/Access/Guards/LdapSessionGuard.php +++ b/app/Auth/Access/Guards/LdapSessionGuard.php @@ -58,13 +58,13 @@ class LdapSessionGuard extends ExternalBaseSessionGuard * Attempt to authenticate a user using the given credentials. * * @param array $credentials - * @param bool $remember + * @param bool $remember * - * @return bool * @throws LdapException*@throws \BookStack\Exceptions\JsonDebugException - * * @throws LoginAttemptException * @throws JsonDebugException + * + * @return bool */ public function attempt(array $credentials = [], $remember = false) { diff --git a/app/Auth/Access/LdapService.php b/app/Auth/Access/LdapService.php index f5d64dab3..2540fe2d8 100644 --- a/app/Auth/Access/LdapService.php +++ b/app/Auth/Access/LdapService.php @@ -295,8 +295,8 @@ class LdapService if ($this->config['dump_user_groups']) { throw new JsonDebugException([ - 'details_from_ldap' => $user, - 'parsed_direct_user_groups' => $userGroups, + 'details_from_ldap' => $user, + 'parsed_direct_user_groups' => $userGroups, 'parsed_recursive_user_groups' => $allGroups, ]); } diff --git a/tests/Auth/LdapTest.php b/tests/Auth/LdapTest.php index c59685ef5..03ef926cb 100644 --- a/tests/Auth/LdapTest.php +++ b/tests/Auth/LdapTest.php @@ -367,7 +367,7 @@ class LdapTest extends TestCase $this->mockLdap->shouldReceive('searchAndGetEntries')->times(4) ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn($userResp, ['count' => 1, - 0 => [ + 0 => [ 'dn' => 'dc=test,' . config('services.ldap.base_dn'), 'memberof' => [ 'count' => 1, @@ -376,13 +376,13 @@ class LdapTest extends TestCase ], ], [ 'count' => 1, - 0 => [ - 'dn' => 'cn=ldaptester,ou=groups,dc=example,dc=com', + 0 => [ + 'dn' => 'cn=ldaptester,ou=groups,dc=example,dc=com', 'memberof' => [ 'count' => 1, 0 => 'cn=monsters,ou=groups,dc=example,dc=com', ], - ] + ], ], ['count' => 0]); $resp = $this->mockUserLogin(); @@ -390,9 +390,9 @@ class LdapTest extends TestCase 'details_from_ldap' => [ 'dn' => 'dc=test,' . config('services.ldap.base_dn'), 'memberof' => [ - 0 => 'cn=ldaptester,ou=groups,dc=example,dc=com', + 0 => 'cn=ldaptester,ou=groups,dc=example,dc=com', 'count' => 1, - ] + ], ], 'parsed_direct_user_groups' => [ 'ldaptester',