diff --git a/src/applications/auth/controller/PhabricatorLDAPRegistrationController.php b/src/applications/auth/controller/PhabricatorLDAPRegistrationController.php index 111c21a9e3..73b9958625 100644 --- a/src/applications/auth/controller/PhabricatorLDAPRegistrationController.php +++ b/src/applications/auth/controller/PhabricatorLDAPRegistrationController.php @@ -50,7 +50,7 @@ extends PhabricatorAuthController { $e_realname = true; $user = new PhabricatorUser(); - $user->setUsername(); + $user->setUsername($provider->retrieveUsername()); $user->setRealname($provider->retrieveUserRealName()); $new_email = $provider->retrieveUserEmail(); diff --git a/src/applications/auth/ldap/PhabricatorLDAPProvider.php b/src/applications/auth/ldap/PhabricatorLDAPProvider.php index 0d98d2beef..496551206a 100644 --- a/src/applications/auth/ldap/PhabricatorLDAPProvider.php +++ b/src/applications/auth/ldap/PhabricatorLDAPProvider.php @@ -99,7 +99,7 @@ final class PhabricatorLDAPProvider { } public function retrieveUsername() { - return $this->userData[$this->getSearchAttribute()][0]; + return $this->userData[$this->getUsernameAttribute()][0]; } public function getConnection() {