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
|
accountBase = ou=people,dc=example,dc=com
|
||||||
accountPattern = (&(objectClass=person)(uid=${username}))
|
accountPattern = (&(objectClass=person)(uid=${username}))
|
||||||
accountDisplayName = displayName
|
accountFullName = displayName
|
||||||
accountEmailAddress = mail
|
accountEmailAddress = mail
|
||||||
#
|
#
|
||||||
groupBase = ou=groups,dc=example,dc=com
|
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.
|
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
|
_(Optional)_ Name of an attribute on the user account object which
|
||||||
contains the initial value for the user's full name field in Gerrit.
|
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 String password;
|
||||||
|
|
||||||
private final EmailExpander emailExpander;
|
private final EmailExpander emailExpander;
|
||||||
private final String accountDisplayName;
|
private final String accountFullName;
|
||||||
private final String accountEmailAddress;
|
private final String accountEmailAddress;
|
||||||
private final String accountSshUserName;
|
private final String accountSshUserName;
|
||||||
private final LdapQuery accountQuery;
|
private final LdapQuery accountQuery;
|
||||||
@@ -113,9 +113,9 @@ class LdapRealm implements Realm {
|
|||||||
// Account query
|
// Account query
|
||||||
//
|
//
|
||||||
final Set<String> accountAtts = new HashSet<String>();
|
final Set<String> accountAtts = new HashSet<String>();
|
||||||
accountDisplayName = optdef(config, "accountDisplayName", "displayName");
|
accountFullName = optdef(config, "accountFullName", "displayName");
|
||||||
if (accountDisplayName != null) {
|
if (accountFullName != null) {
|
||||||
accountAtts.add(accountDisplayName);
|
accountAtts.add(accountFullName);
|
||||||
}
|
}
|
||||||
accountEmailAddress = optdef(config, "accountEmailAddress", "mail");
|
accountEmailAddress = optdef(config, "accountEmailAddress", "mail");
|
||||||
if (accountEmailAddress != null) {
|
if (accountEmailAddress != null) {
|
||||||
@@ -177,7 +177,7 @@ class LdapRealm implements Realm {
|
|||||||
public boolean allowsEdit(final Account.FieldName field) {
|
public boolean allowsEdit(final Account.FieldName field) {
|
||||||
switch (field) {
|
switch (field) {
|
||||||
case FULL_NAME:
|
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:
|
case SSH_USER_NAME:
|
||||||
return accountSshUserName == null; // only if not obtained from LDAP
|
return accountSshUserName == null; // only if not obtained from LDAP
|
||||||
@@ -195,7 +195,7 @@ class LdapRealm implements Realm {
|
|||||||
try {
|
try {
|
||||||
final LdapQuery.Result m = findAccount(ctx, username);
|
final LdapQuery.Result m = findAccount(ctx, username);
|
||||||
|
|
||||||
who.setDisplayName(m.get(accountDisplayName));
|
who.setDisplayName(m.get(accountFullName));
|
||||||
who.setSshUserName(m.get(accountSshUserName));
|
who.setSshUserName(m.get(accountSshUserName));
|
||||||
|
|
||||||
if (accountEmailAddress != null) {
|
if (accountEmailAddress != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user