Change ldap.accountDisplayName to ldap.accountFullName
Internally in Gerrit's database and the web UI we call this field "Full Name", or "full_name", so we really should use that same term in the left hand side of the LDAP configuration. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -478,7 +478,7 @@ common deployments.
|
||||
#
|
||||
accountBase = ou=people,dc=example,dc=com
|
||||
accountPattern = (&(objectClass=person)(uid=${username}))
|
||||
accountDisplayName = displayName
|
||||
accountFullName = displayName
|
||||
accountEmailAddress = mail
|
||||
#
|
||||
groupBase = ou=groups,dc=example,dc=com
|
||||
@@ -523,7 +523,7 @@ setting depends on the LDAP schema used by the directory server.
|
||||
+
|
||||
Default is `(uid=$\{username\})`, matching RFC 2307.
|
||||
|
||||
[[ldap.accountDisplayName]]ldap.accountDisplayName::
|
||||
[[ldap.accountFullName]]ldap.accountFullName::
|
||||
+
|
||||
_(Optional)_ Name of an attribute on the user account object which
|
||||
contains the initial value for the user's full name field in Gerrit.
|
||||
|
||||
@@ -58,7 +58,7 @@ class LdapRealm implements Realm {
|
||||
private final String password;
|
||||
|
||||
private final EmailExpander emailExpander;
|
||||
private final String accountDisplayName;
|
||||
private final String accountFullName;
|
||||
private final String accountEmailAddress;
|
||||
private final String accountSshUserName;
|
||||
private final LdapQuery accountQuery;
|
||||
@@ -113,9 +113,9 @@ class LdapRealm implements Realm {
|
||||
// Account query
|
||||
//
|
||||
final Set<String> accountAtts = new HashSet<String>();
|
||||
accountDisplayName = optdef(config, "accountDisplayName", "displayName");
|
||||
if (accountDisplayName != null) {
|
||||
accountAtts.add(accountDisplayName);
|
||||
accountFullName = optdef(config, "accountFullName", "displayName");
|
||||
if (accountFullName != null) {
|
||||
accountAtts.add(accountFullName);
|
||||
}
|
||||
accountEmailAddress = optdef(config, "accountEmailAddress", "mail");
|
||||
if (accountEmailAddress != null) {
|
||||
@@ -177,7 +177,7 @@ class LdapRealm implements Realm {
|
||||
public boolean allowsEdit(final Account.FieldName field) {
|
||||
switch (field) {
|
||||
case FULL_NAME:
|
||||
return accountDisplayName == null; // only if not obtained from LDAP
|
||||
return accountFullName == null; // only if not obtained from LDAP
|
||||
|
||||
case SSH_USER_NAME:
|
||||
return accountSshUserName == null; // only if not obtained from LDAP
|
||||
@@ -195,7 +195,7 @@ class LdapRealm implements Realm {
|
||||
try {
|
||||
final LdapQuery.Result m = findAccount(ctx, username);
|
||||
|
||||
who.setDisplayName(m.get(accountDisplayName));
|
||||
who.setDisplayName(m.get(accountFullName));
|
||||
who.setSshUserName(m.get(accountSshUserName));
|
||||
|
||||
if (accountEmailAddress != null) {
|
||||
|
||||
Reference in New Issue
Block a user