mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 18:22:41 +01:00
<LDAP: If available use DN from previously retrieved user>
Summary: When searching for a user before logging in use the DN from the retrived user. This allows you to use a less fine grained DN when searching for a user. For example dc=domain,dc=domain instead of ou=unit,dc=domain,dc=com. Test Plan: Tested on local install with ldap.search-first disabled and enabled. Reviewers: epriestley, yunake Reviewed By: epriestley CC: auduny, briancline, aran, Korvin, vsuba Differential Revision: https://secure.phabricator.com/D3549
This commit is contained in:
parent
f47c0a3a06
commit
874fb9b6d9
1 changed files with 9 additions and 5 deletions
|
@ -143,11 +143,15 @@ final class PhabricatorLDAPProvider {
|
|||
if ($activeDirectoryDomain) {
|
||||
$dn = $username.'@'.$activeDirectoryDomain;
|
||||
} else {
|
||||
$dn = ldap_sprintf(
|
||||
'%Q=%s,%Q',
|
||||
$this->getSearchAttribute(),
|
||||
$username,
|
||||
$this->getBaseDN());
|
||||
if (isset($user)) {
|
||||
$dn = $user['dn'];
|
||||
} else {
|
||||
$dn = ldap_sprintf(
|
||||
'%Q=%s,%Q',
|
||||
$this->getSearchAttribute(),
|
||||
$username,
|
||||
$this->getBaseDN());
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: It is very important we suppress any messages that occur here,
|
||||
|
|
Loading…
Reference in a new issue