Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0036873mantisbtldappublic2026-05-14 14:15
Reporterraspopov Assigned Tocommunity  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.28.0 
Target Version2.29.0Fixed in Version2.29.0 
Summary0036873: When creating or updating a user, the email address and real name are not synchronized with LDAP
Description

There are two cases:

  1. When a user is created, the database is not initially populated with their email address and real name from LDAP.

  2. When updating a user who is not present in LDAP, their email and real name are cleared.

Steps To Reproduce

The use_ldap_realname and use_ldap_email options must be set to ON.

Additional Information

The problem is probably caused by the fact that the ldap_email_from_username() function and other similar functions do not return null or another error indicator if the user is not found in LDAP. The design of internal function calls suggests that this was most likely intended.

TagsNo tags attached.

Relationships

related to 0024044 resolvedcommunity Getting user name and email from LDAP without LDAP authentication 

Activities

raspopov

raspopov

2026-02-09 11:28

reporter   ~0070781

Last edited: 2026-02-09 11:31

If LDAP is used, the UserUpdateCommand is invoked at the end with empty strings for email and real name rather than null values. These empty strings are interpreted as new values, which empties the database fields.

As far as I understand, MantisBT contains code that works directly with the database, bypassing the User API. Perhaps the same code is used in plugins, so it is better to have the most recent versions of the email address and real user name in the database.

PR: https://github.com/mantisbt/mantisbt/pull/2184

Better after 0024044.

Related Changesets

MantisBT: pr2124 038a6be5

2026-02-09 11:16

raspopov

Committer: dregad


Details Diff
Fix the synchronization of mail and real name with LDAP

- The update of the email address and real name to the database from
LDAP was added when a user is created.
- Corrected the issue of erroneously clearing the email and real name
from the database when updating a non-existent user in LDAP.

Fixes 0036873, PR https://github.com/mantisbt/mantisbt/pull/2184
Affected Issues
0036873
mod - core/commands/UserUpdateCommand.php Diff File
mod - core/user_api.php Diff File