mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 09:58:24 +01:00
Fall back to LDAP search attribute if username attribute is not configured
Summary: See discussion in D3340. Some configurations set only a search attribute because their records are indexed by username (this is probably not quite the correct LDAP terminology). Other configurations use one attribute to search and a different attribute to select usernames. After D3340, installs which set only a search attribute broke. Instead, fall back to the search attribute if no username attribute is present. Test Plan: Successfully logged in on my test slapd. Reviewers: yunake, voldern, briancline Reviewed By: voldern CC: aran Differential Revision: https://secure.phabricator.com/D3406
This commit is contained in:
parent
ada5f81614
commit
e3c6dc687a
1 changed files with 4 additions and 1 deletions
|
@ -99,7 +99,10 @@ final class PhabricatorLDAPProvider {
|
|||
}
|
||||
|
||||
public function retrieveUsername() {
|
||||
return $this->userData[$this->getUsernameAttribute()][0];
|
||||
$key = nonempty(
|
||||
$this->getUsernameAttribute(),
|
||||
$this->getSearchAttribute());
|
||||
return $this->userData[$key][0];
|
||||
}
|
||||
|
||||
public function getConnection() {
|
||||
|
|
Loading…
Add table
Reference in a new issue