Page MenuHomePhabricator

D14244.diff
No OneTemporary

D14244.diff

diff --git a/src/auth/PhutilLDAPAuthAdapter.php b/src/auth/PhutilLDAPAuthAdapter.php
--- a/src/auth/PhutilLDAPAuthAdapter.php
+++ b/src/auth/PhutilLDAPAuthAdapter.php
@@ -11,6 +11,7 @@
private $baseDistinguishedName;
private $searchAttributes = array();
private $usernameAttribute;
+ private $emailAttribute;
private $realNameAttributes = array();
private $ldapVersion = 3;
private $ldapReferrals;
@@ -59,6 +60,11 @@
return $this;
}
+ public function setEmailAttribute($email_attribute) {
+ $this->emailAttribute = $email_attribute;
+ return $this;
+ }
+
public function setRealNameAttributes(array $attributes) {
$this->realNameAttributes = $attributes;
return $this;
@@ -153,6 +159,13 @@
}
public function readLDAPRecordEmail(array $record) {
+ $result = '';
+ if ($this->emailAttribute) {
+ $result = $this->readLDAPData($record, $this->emailAttribute);
+ }
+ if (strlen(trim($result))) {
+ return $result;
+ }
return $this->readLDAPData($record, 'mail');
}

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 21, 8:27 PM (58 m, 36 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6772088
Default Alt Text
D14244.diff (1 KB)

Event Timeline