View Issue Details

IDProjectCategoryView StatusLast Update
0029230mantisbtldappublic2023-10-31 16:32
ReportersebastianOspina Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.25.2 
Target Version2.26.0Fixed in Version2.26.0 
Summary0029230: Can't set a custom field for ldap email
Description

I have setted up LDAP authentication.
also
$g_use_ldap_email = ON;
$g_use_ldap_realname = ON;

My organization has setted the LDAP email field to "mail1".
For this reason, when a user login to matis the email it's not saved, even if the $g_use_ldap_email option it's set to ON

Is there a way to custom this field, like $g_ldap_realname_field or $g_ldap_uid_field ?

Steps To Reproduce
  1. Set up LDAP authentication.
  2. Set $g_use_ldap_email = ON;
  3. Try to loggin using a LDAP server that has a different email field name, like "mail1,mail2, etc"
TagsNo tags attached.

Activities

sebastianOspina

sebastianOspina

2021-10-27 19:28

reporter   ~0065958

Fixed changing line 262 of ldap_api.php

dregad

dregad

2021-10-28 12:04

developer   ~0065960

E-mail field cannot be customized at the moment, this would require a new config option.

Fixed changing line 262 of ldap_api.php

Yes, that's one of them ldap_cache_user_data() , but you need also to change it in ldap_email_from_username() function (line 179).

dregad

dregad

2021-10-28 12:19

developer   ~0065963

I guess it makes sense to allow customizing this. I prepared a patch for it, see PR https://github.com/mantisbt/mantisbt/pull/1784

@sebastianOspina it would be nice if you could apply the patch on your instance, test it and let me know your feedback, either here or in the PR.

Related Changesets

MantisBT: master cca76325

2021-10-28 08:14

dregad


Details Diff
Add new config $g_ldap_email_field

Allows customizing the LDAP field used to store the user's e-mail
address, when $g_use_ldap_email = ON.

Fixes 0029230
Affected Issues
0029230
mod - config_defaults_inc.php Diff File
mod - core/ldap_api.php Diff File
mod - docbook/Admin_Guide/en-US/config/auth.xml Diff File