Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0011546mantisbtldappublic2012-07-20 14:13
Reportertk Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version1.2.0 
Summary0011546: g_use_ldap_realname = ON only works for logged in user
Description

I've been using
$g_show_realname = ON;
successfully for a longer time.

Now I enabled realname lookup from ldap (or, more exactly from AD in my case) with
$g_use_ldap_realname = ON;

On my installation the realname will only be obtained from the directory service for the currently logged-in user. Realname information for all other users (e.g., in drop-down boxes, view-issues page) will be obtained from mantis database.

If I click on a user on manager users page, also LDAP/AD realname will be displayed.

TagsNo tags attached.
Attached Files

Relationships

related to 0011755 new $g_use_ldap_realname set to ON is sometimes ignored 

Activities

dregad

dregad

2010-11-04 15:32

developer   ~0027255

Considering that Mantis updates the DB with LDAP information after successful login, from my point of view the current behavior is fine, I don't see the purpose of querying the LDAP all the time.

tk

tk

2010-11-08 02:45

reporter   ~0027280

a) does it really update the /entire/ DB ?
as I said above, in my experiments only the logged-in user was updated. My mantis instances have to deal with several hundreds to thousands of users

b) i (and my users) run my Linux-box about one month w/o reboot (then i issue a forced reboot to all machines). this is the timespan that my mantis-login is open. so update once per login is not sufficent.

dregad

dregad

2010-11-08 03:27

developer   ~0027284

You are correct, the DB info is updated once, at login-time, for the user who is connecting only.

I guess it really depends on how static the LDAP data is. Meaning, how frequently do users' names and e-mails get updated. For me, this data changes very rarely, maybe in your case it's different.

As a workaround, you could maybe try to reduce the cookie's validity (g_cookie_time_length) to force a more frequent refresh ?

If I understand your need correctly, is that email and name should systematically be pulled from LDAP, without using a cache (i.e. the Mantis DB).

tk

tk

2010-11-08 04:31

reporter   ~0027285

An hourly update would be sufficient.

Regarding g_cookie_time_length I assume that I have to re-authenticate as soon as this cookie expires, don't I? -- This would not be acceptable.

cas

cas

2010-11-08 04:50

reporter   ~0027286

Last edited: 2010-11-08 06:18

Still have a hard time to understand why a realname should be updated every hour? My name stays the same for as long as I live.
So if this all is so critical, why not write a small script that as often as you want, runs through the user table and updates it with info from AD?

Attached a small script that retrieves all users from AD (have fun)

tk

tk

2010-11-08 07:02

reporter   ~0027291

I'm not talking of my personal account, but of the thousands of users that are enlisted in our general users database (and where I've attached mantis to via LDAP/AD).
My estimates are that >10 accounts are being added / modified per day.

cas

cas

2010-11-08 07:41

reporter   ~0027294

In case you want to see their AD names in mantis all the way, suggest you use the provided script to update the mantis_user_table on a regular base.

dregad

dregad

2010-11-08 07:43

developer   ~0027295

So the requirement is that all users in your LDAP should be registered in Mantis, with up-to-date name/e-mail, right ? In that case, I think the script solution mentioned by CAS, to add/update account information in the Mantis DB, is really the best option for you.

The alternative would be to make the lookup of this information completely dynamic, i.e. read from LDAP everytime name/email is needed (and to never use the DB, or to build a cache with a configurable expiration). In terms of efficiency, this does not sound too good as it would cause a very large volume of LDAP traffic.

cas

cas

2010-11-08 07:53

reporter   ~0027297

The script allows both ways, one can control Mantis user table from AD (Adding/Updating) or simply update Mantis with correct values.
This however does not resolve the issue that Mantis apparently is not consistens using "use_ldap_realname".
Constantly consulting LDAP may have perfomance issues so a better option could be to introduce a field LDAP_Realname in the usertable which then could be updated upon login. This still requires mantis to work consistently according the settings

tk

tk

2010-11-08 07:58

reporter   ~0027298

from the discussion i conclude i have two requirements

a) major: automatical repeated update of the entire mantis users db against ldap, based on parameterised cookie expiry (I cannot use cron)

b) minor: really constistent use of "real name" in mantis

cas

cas

2010-11-08 08:02

reporter   ~0027300

b) is a true Mantis issue whereas for a) you have a challenge.
How often do you need updates?
What is the issue with Cron?

dregad

dregad

2010-11-08 08:27

developer   ~0027303

really constistent use of "real name" in mantis

I think it is consistent today... Always pulling the information from DB (and having DB refreshed from LDAP at each user's login). If I'm mistaken, can you please point out precisely what you think is not consistent ?

tk

tk

2010-11-08 08:28

reporter   ~0027304

Last edited: 2010-11-08 08:42

in reply to 0011546:0027300:
ad a)
a1) approx 1 per hour (rather less frequent than more frequent)
a2) i don't have cron access on web server machines. why not use a cookie similar to administration login expiry?

tk

tk

2010-11-08 08:42

reporter   ~0027306

in reply to 0011546:0027303:
cas, can you point out your note 0011546:0027297 regarding consistent use of "use_ldap_realname" ?

cas

cas

2010-11-08 10:42

reporter   ~0027311

Consistent use, see issue 11755.

As for why not use cookie, then it becomes an issue of mantis to update the entire user database. In my view this is not a mantis requirement.
As for cron, there must be someone in your company that can access cron on the webserver or are you using services from an external provider?

tk

tk

2010-11-16 01:45

reporter   ~0027372

cron simply is not admissible in the way we operate our web services

tk

tk

2012-07-05 10:21

reporter   ~0032254

Last edited: 2012-07-05 10:22

... in my case, the real name update does not work, anyway.

But I have following idea regarding the real name update issue:
With the aim to have minimum load on the AD/LDAP server the following is sufficient:
a) query real name from AD and store into the mantis DB when a new user is signed up
b) let the user edit the real name stored in the database via the myaccount page in case of short-term change of name (in common, marriage)
c) below admin.php add a facility to update all real names stored in the mantis database by command of mantis administrator (only those real names that actually can be obtained from the AD server)

Access to the AD database is granted via the standard LDAP-interface as it will be needed for authetication - you need a binding user

dregad

dregad

2012-07-06 06:31

developer   ~0032255

a) query real name from AD and store into the mantis DB when a new user is signed up

This is exactly what MantisBT does today.
The name is also refreshed each time the user logs in.

... in my case, the real name update does not work, anyway.

Which version are you using ? I just (re-)tested this and it works fine for me.

b) let the user edit the real name stored in the database via the myaccount page in case of short-term change of name (in common, marriage)

Are you suggesting that MantisBT updates your LDAP with the updated information ?

In my opinion, an easier and probably more correct way of handling this, would be to update your Master Data, i.e. the LDAP (following your company's HR process I guess), then ask user to login again so that the Mantis DB gets updated.

c) below admin.php add a facility to update all real names stored in the mantis database by command of mantis administrator (only those real names that actually can be obtained from the AD server)

I think this actually is a good idea, but beyond the scope of MantisBT. This could probably be built as a plugin, but I see little chance of it making it into the core.

tk

tk

2012-07-06 06:51

reporter   ~0032256

a)
currently I'm using 1.2.10, but I had to stop using real names in 1.2.0 .

b)
As far as I understood the mantis mechanism in the beginning, mantis would query the LDAP service once for the user's realname in case of sign-in, cf. a), and then would store it in the mantis database.
If the refresh in the mantis db takes place at user login, that's ok

c)
During updates I use a shell script which scans the mantis database for userkeys that have been disabled in the LDAP master-db, and disables them in the mantis db. I see I have to extend it into that direction.
Anyway, for initial filling the mantis db with all users' real names I need such a general query and update tool, since I cannot hope that >>100 users will login at the first day after the change to real names for the mantis to to be updated via the individual logins.

tk

tk

2012-07-06 07:27

reporter   ~0032257

something I forgot:
What if a user will not login for rather a long time, but his real name changes?
In this case only c) would be an appropriate method for the mantis administrator in case of many accounts to survey.

dregad

dregad

2012-07-06 07:41

developer   ~0032259

Which all boils down to your point c) - you need some external tool to handle mass-updating of Mantis user table based on LDAP query.

You either need to use an external script or, as I suggested earlier, write a plugin that will add a new button for the Administrator to trigger the mechanism from e.g. the user admin page.

Based on the above as well as your earlier response 0011546:0032256, from my perspective there is no issue with MantisBT.

tk

tk

2012-07-09 07:36

reporter   ~0032275

agreed