Open Bug 1356897 Opened 8 years ago Updated 7 months ago

[LDAP] The realname set in Bugzilla is overriden every time a user logs in

Categories

(Bugzilla :: User Accounts, defect)

5.0.3
defect
Not set
normal

Tracking

()

People

(Reporter: LpSolit, Unassigned)

References

Details

The "Account Information" tab in User Preferences (a.k.a userprefs.cgi?tab=account) always lets you edit your real name, even when using LDAP, but this change is only stored in the Bugzilla DB and is overriden every time the user logs in, because Bugzilla::Auth::Verify::create_or_update_user() calls: if ($real_name && $user->name ne $real_name) { $user->set_name($real_name); and Bugzilla::Auth::Verify::LDAP::check_credentials() always looks for the real name store in LDAP: $params->{realname} ||= $user_entry->get_value("displayName"); $params->{realname} ||= $user_entry->get_value("cn"); This behavior is confusing, see e.g. https://bugs.mageia.org/show_bug.cgi?id=20686. Bugzilla should do one of the following: 1) The real name field in userprefs.cgi should be read-only or not displayed at all when using LDAP (RADIUS doesn't set 'realname' and so is not affected). This way, the real name is always set by LDAP. 2) The real name is set by LDAP only when creating the user account in Bugzilla. Once the user account exists in Bugzilla, the real name returned by LDAP is ignored. This way, a user can edit his real name from userprefs.cgi. This is my preferred solution. 3) Updating the real name in userprefs.cgi should also update it in LDAP. I don't know if this is doable nor if this is the desired behavior. So probably a bit dangerous.
I vote for #2 as well. I think it is somewhat common to use the realname field for status messages and the like.

You can change the variable $params->{realname} ||= $user_entry->get_value("displayName"); into whatever you need from LDAP as a workaround
Have a look here https://bugzilla.mozilla.org/show_bug.cgi?id=1870609

Duplicate of this bug: 1870609
You need to log in before you can comment on or make changes to this bug.