Merge branch 'master' into release
This commit is contained in:
commit
83d06beb70
|
@ -103,7 +103,7 @@ class LoginController extends Controller
|
||||||
|
|
||||||
// Sync LDAP groups if required
|
// Sync LDAP groups if required
|
||||||
if ($this->ldapService->shouldSyncGroups()) {
|
if ($this->ldapService->shouldSyncGroups()) {
|
||||||
$this->ldapService->syncGroups($user);
|
$this->ldapService->syncGroups($user, $request->get($this->username()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = session()->pull('url.intended', '/');
|
$path = session()->pull('url.intended', '/');
|
||||||
|
|
|
@ -299,11 +299,12 @@ class LdapService
|
||||||
/**
|
/**
|
||||||
* Sync the LDAP groups to the user roles for the current user
|
* Sync the LDAP groups to the user roles for the current user
|
||||||
* @param \BookStack\User $user
|
* @param \BookStack\User $user
|
||||||
|
* @param string $username
|
||||||
* @throws LdapException
|
* @throws LdapException
|
||||||
*/
|
*/
|
||||||
public function syncGroups(User $user)
|
public function syncGroups(User $user, string $username)
|
||||||
{
|
{
|
||||||
$userLdapGroups = $this->getUserGroups($user->external_auth_id);
|
$userLdapGroups = $this->getUserGroups($username);
|
||||||
|
|
||||||
// Get the ids for the roles from the names
|
// Get the ids for the roles from the names
|
||||||
$ldapGroupsAsRoles = $this->matchLdapGroupsToSystemsRoles($userLdapGroups);
|
$ldapGroupsAsRoles = $this->matchLdapGroupsToSystemsRoles($userLdapGroups);
|
||||||
|
|
Loading…
Reference in New Issue