Skip to content

Commit

Permalink
Bugfix LDAP fields map
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Chernyi committed May 1, 2018
1 parent 98899ef commit 1e4fc22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Auth/Repository/LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ public function getByLogin(string $login): ?Root
foreach ($collection->toArray() as $entry) {
$user = $this->entity($this->config('auth.entity'))->load($entry->getDn(), $this->config('auth.ldap.fields.loginInDb', 'email'));
foreach ($entry->getAttributes() as $attribute => $value) {
$field = $this->config('auth.fields.map.'.$attribute);
$field = $this->config('auth.ldap.fields.map.'.$attribute);
if ($field) {
$user->set($field, $value[0] ?? null);
}
$user->set($this->config('auth.ldap.fields.loginInDb', 'email'), $entry->getDn());
}
$user->save();

Expand Down

0 comments on commit 1e4fc22

Please sign in to comment.