Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ private function addRoleNode()
->scalarNode('user_attribute')->defaultValue('member')->end()
->scalarNode('user_id')->defaultValue('dn')
->validate()
->ifNotInArray(array('dn', 'username'))
->thenInvalid('Only dn or username')
->ifNotInArray(array('dn', 'username', 'uid'))
->thenInvalid('Only dn, username or uid')
->end()
->end()
->end()
Expand Down
8 changes: 6 additions & 2 deletions Manager/LdapManagerUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ public function auth()
if (strlen($this->password) === 0) {
throw new ConnectionException('Password can\'t be empty');
}

if (null === $this->ldapUser) {
$this->bindByUsername();
$this->doPass();
} else {
$this->doPass();
$this->bindByDn();
}
}
}

/**
Expand Down Expand Up @@ -276,6 +276,10 @@ private function getUserId()
return $this->username;
break;

case 'uid':
return $this->username;
break;

default:
throw new \Exception(sprintf("The value can't be retrieved for this user_id : %s",$this->params['role']['user_id']));
}
Expand Down