Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15421604
D10661.id27433.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10661.id27433.diff
View Options
diff --git a/src/applications/people/controller/PhabricatorPeopleLdapController.php b/src/applications/people/controller/PhabricatorPeopleLdapController.php
--- a/src/applications/people/controller/PhabricatorPeopleLdapController.php
+++ b/src/applications/people/controller/PhabricatorPeopleLdapController.php
@@ -149,6 +149,9 @@
$results = $ldap_adapter->searchLDAP('%Q', $search);
+ $existing_users = id(new PhabricatorPeopleQuery())->execute();
+ $existing_users = (mpull($existing_users, 'getUserName'));
+
foreach ($results as $key => $record) {
$account_id = $ldap_adapter->readLDAPRecordAccountID($record);
if (!$account_id) {
@@ -161,8 +164,12 @@
$ldap_adapter->readLDAPRecordEmail($record),
$ldap_adapter->readLDAPRecordRealName($record),
);
- $results[$key] = $info;
- $results[$key][] = $this->renderUserInputs($info);
+
+ if (!in_array(strtolower(idx($info, 0)), $existing_users) &&
+ !in_array(strtoupper(idx($info, 0)), $existing_users)) {
+ $results[$key] = $info;
+ $results[$key][] = $this->renderUserInputs($info);
+ }
}
$form = id(new AphrontFormView())
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 23, 1:16 AM (20 h, 4 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7701061
Default Alt Text
D10661.id27433.diff (1 KB)
Attached To
Mode
D10661: skip over already existing users when displying ldap import search results. Ref T6267
Attached
Detach File
Event Timeline
Log In to Comment