View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0034566 | mantisbt | administration | public | 2024-08-08 07:25 | 2024-08-25 04:31 |
Reporter | hendrik.klemp | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.26.0 | ||||
Target Version | 2.26.3 | Fixed in Version | 2.26.3 | ||
Summary | 0034566: The "realname" field is cleared after a user is updated. | ||||
Description | In version 2.26.1 and 2.26.2 the field "realname" of the user is deleted if the user has been updated by an administrator. We use the LDAP connection for user administration. And have also set the following variables. $g_use_ldap_realname = ON; In the log file I can see that the connection to the LDAP server is successful but the realname was cleared in the SQL Statement. 2024-08-07 09:17 UTC LDAP ldap_api.php:317 ldap_get_field_from_username() Retrieving field 'displayName' for 'UserIDxxx' | ||||
Steps To Reproduce | 1) Log in to the system as an administrator | ||||
Tags | No tags attached. | ||||
Just to clarify, as you mentioned 2.26.1 & 2.26.2, does this mean that it was working in earlier versions ? Or did you just not test ?
This Seems like a bug either in LDAP API or the UserUpdateCommand, need to have a look at the code. |
|
I can reproduce the problem using LDAP simulation. It is caused by incorrect logic in UserUpdateCommand::validate() function:
$t_new_username is null (because it was not changed), so $t_username is set to true, which is treated as string This regression was introduced in 0032464. |
|
Thank you for the quick solution |
|
MantisBT: master-2.26 67839c27 2024-08-09 12:55 Details Diff |
Do not clear realname when updating user with LDAP When $g_use_ldap_realname = ON, wrong logic in method UserUpdateCommand::validate() caused 'True' to be passed as username parameter to ldap_realname_from_username(), which returned null instead of the expected real name, as the user '1' cannot be found in the LDAP directory (an incorrect realname would have been returned, if this user existed). Fixes 0034566 |
Affected Issues 0034566 |
|
mod - core/commands/UserUpdateCommand.php | Diff File |