View Issue Details

IDProjectCategoryView StatusLast Update
0020154mantisbtldappublic2015-10-18 10:11
Reporterasterix67 Assigned Todregad  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionno change required 
Product Version1.2.14 
Summary0020154: LDAP : get the realname (not the id) of the user on the differents views
Description

Having set authentication to LDAP, in the account windows the realname is ok.

But in the different views or list (Assigned to ..) i have the reporter.id or developer.id , not the realname. Why?

$g_use_ldap_realname is set to ON;

TagsNo tags attached.

Activities

dregad

dregad

2015-10-01 03:07

developer   ~0051561

It's not 100% clear what your expectation is. We never display the user 'id' (which is a sequential number used only internally). Are you referring to the username (i.e. 'asterix67') ?

If that's the case, try setting

$g_show_realname = ON;
$g_show_user_realname_threshold = ANYBODY;

$g_use_ldap_realname only tells Mantis to always dynamically retrieve the name from LDAP instead of using the one stored in the DB (which, since it's normally copied from LDAP, acts like a cache) when displaying the Realname.

Hope this helps
Bonne journée

PS: as a side note, I recommend you upgrade to 1.2.19.

asterix67

asterix67

2015-10-01 12:03

reporter   ~0051564

Thanks a lot dregad i try tomorrow.

Have a nice day too.
Bonne journée à toi ;-)

asterix67

asterix67

2015-10-02 15:48

reporter   ~0051581

Hi,
It's ok the issue can be closed :
I had forgotten $g_ldap_realname_field = 'cn'

Thanks.

asterix67

asterix67

2015-10-02 15:59

reporter   ~0051582

Just two questions or problems ...

In the LDAP of my company we have LDAP username > 30 characters.
How can i input the username in the username field of the "create new user" windows ? (The max of the field is 30 characters).

Another question : why realname and email fields are protected in my "create new user" windows ?

Thanks

asterix67

asterix67

2015-10-03 11:25

reporter   ~0051585

Hi,

OK i understand my first problem: the column username in the mantis_user_table is in varchar2(32).

So i need to create manually a user with a username < 30 characters and with the same LDAP email of the LDAP user with username > 30 characters.

But it's impossible : the realname and email fields are protected in the "create new user" windows when i want create a new user.

Why ? i don't understand . Thanks for your help.

The only way is to insert the user in the database by a insert SQL command with mySQL ???

dregad

dregad

2015-10-03 19:52

developer   ~0051591

Another question : why realname and email fields are protected in my "create new user" windows ?

When $g_use_ldap_realname is ON, the master data is in LDAP, and Mantis fields are only used as cache, so it does not make sense to edit them because any changes would be overwritten sooner or later, usually with the user's next login.

With regards to username field size, this is a known issue, see 0008017. I can't think of any workaround except manually patching your system (modifying the DB_FIELD_SIZE_USERNAME constant and altering username column in DB, via SQL).
This may cause issues with future upgrades, so do this at your own risk.

asterix67

asterix67

2015-10-04 12:47

reporter   ~0051593

OK super for example to increase to 64 characters max:

1) with SQL :
alter table mantis_user_table change username varchar(64);

2) /core/constant_inc.php :
define ( 'DB_FIELD_SIZE_USERNAME',64);

3) for the future installation database :
admin/schema.php :
$g_upgrade[196]=array( 'AlterColumnSQL', array( db_get_table( 'user '), "username C(64) $t_notnull DEFAULT \" '

Thanks a lot.

dregad

dregad

2015-10-04 17:50

developer   ~0051597

Do NOT alter schema.php, that will 100% cause issues with future upgrade. As I said before, alter the field by issuing an SQL DDL command to increase column size directly in your RDBMS.