View Issue Details

IDProjectCategoryView StatusLast Update
0023390mantisbtldappublic2018-06-13 04:04
ReporterMr.Bricodage Assigned To 
Status newResolutionopen 
Product Version1.3.12 
Summary0023390: Unable to auth user through SOAP API if special char in LDAP realname

LDAP Realname content (CN) in my company AD sometimes contains special French chars. I haven't access to AD to modify this information. For example, the char é has hexa code \xe9.

This is a "little" problem when displaying data in Mantis GUI ( Gérard is displayed G? ) and a big problem when using SOAP to log in (exception Exception with message "SOAP-ERROR: Encoding: string 'G\xe9...' is not a valid utf-8 string - thrown by method : mc_login"),
==> SOAP cannot be used to authenticate some users.

Additional Information

To partially fix this problem, I modified ldap_api.php, function ldap_realname_from_username on row 186

$t_realname = ldap_get_field_from_username( $p_username, $t_ldap_realname_field );
is now
$t_realname = utf8_decode(ldap_get_field_from_username( $p_username, $t_ldap_realname_field ));

The result is now G?rard in Mantis GUI ( better than G? ) and we can log in through SOAP API.

$t_realname = ldap_escape_string(ldap_get_field_from_username( $p_username, $t_ldap_realname_field )); seems to bypass the problem too but not to display french chars.

TagsNo tags attached.


related to 0020809 new Auth with AD KO when UTF-8 chars in password 




2018-03-02 17:35

reporter   ~0059071

based on note 0020809:0059069, I'll try ASAP

$t_realname = use iconv( "UTF-8", "Windows-1252", ldap_get_field_from_username( $p_username, $t_ldap_realname_field ));



2018-06-13 04:04

reporter   ~0060083

Confirmed, by replacing utf-8 decode() by iconv() , special chars are now well displayed

Issue History

Date Modified Username Field Change
2017-09-22 05:58 Mr.Bricodage New Issue
2018-03-02 17:35 Mr.Bricodage Note Added: 0059071
2018-03-02 21:52 vboctor Relationship added related to 0020809
2018-06-13 04:04 Mr.Bricodage Note Added: 0060083