Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18937034
D14245.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14245.id.diff
View Options
diff --git a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
@@ -44,6 +44,8 @@
->setUsernameAttribute(
$conf->getProperty(self::KEY_USERNAME_ATTRIBUTE))
->setRealNameAttributes($realname_attributes)
+ ->setEmailAttribute(
+ $conf->getProperty(self::KEY_EMAIL_ATTRIBUTE))
->setLDAPVersion(
$conf->getProperty(self::KEY_VERSION))
->setLDAPReferrals(
@@ -188,6 +190,7 @@
const KEY_DISTINGUISHED_NAME = 'ldap:dn';
const KEY_SEARCH_ATTRIBUTES = 'ldap:search-attribute';
const KEY_USERNAME_ATTRIBUTE = 'ldap:username-attribute';
+ const KEY_EMAIL_ATTRIBUTE = 'ldap:email-attribute';
const KEY_REALNAME_ATTRIBUTES = 'ldap:realname-attributes';
const KEY_VERSION = 'ldap:version';
const KEY_REFERRALS = 'ldap:referrals';
@@ -211,6 +214,7 @@
self::KEY_ANONYMOUS_USERNAME => pht('Anonymous Username'),
self::KEY_ANONYMOUS_PASSWORD => pht('Anonymous Password'),
self::KEY_USERNAME_ATTRIBUTE => pht('Username Attribute'),
+ self::KEY_EMAIL_ATTRIBUTE => pht('Email Attribute'),
self::KEY_REALNAME_ATTRIBUTES => pht('Realname Attributes'),
self::KEY_VERSION => pht('LDAP Version'),
self::KEY_REFERRALS => pht('Enable Referrals'),
@@ -286,6 +290,9 @@
self::KEY_USERNAME_ATTRIBUTE =>
pht('Example: %s',
phutil_tag('tt', array(), pht('sn'))),
+ self::KEY_EMAIL_ATTRIBUTE =>
+ pht('Example: %s',
+ phutil_tag('tt', array(), pht('userPrincipalName'))),
self::KEY_REALNAME_ATTRIBUTES =>
pht('Example: %s',
phutil_tag('tt', array(), pht('firstname, lastname'))),
@@ -374,6 +381,8 @@
'prefill the "Real Name" field when registering a new account. This '.
'is purely cosmetic and does not affect the login process, but can '.
'make registration a little easier.'),
+ self::KEY_EMAIL_ATTRIBUTE => pht(
+ "Optionally, specify an attribute to use to select the user's email."),
);
foreach ($labels as $key => $label) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 11 2025, 9:46 PM (9 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8542860
Default Alt Text
D14245.id.diff (2 KB)
Attached To
Mode
D14245: Added support for settings the LDAP email attribute
Attached
Detach File
Event Timeline
Log In to Comment