View Issue Details

IDProjectCategoryView StatusLast Update
0014673mantisbtldappublic2014-09-23 18:05
Reporterrombert Assigned Torombert  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.11 
Target Version1.2.12Fixed in Version1.2.12 
Summary0014673: LDAP login performs unnecessary SQL updates
Description

When a user is authenticated using LDAP, the following information is updated in the mantis_user_table

<ol><li>password</li><li>realname</li><li>email</li></ol>

The updates are done in 3 distinct SQL calls. We should either

<ol><li>batch the three updates in one single SQL call OR</li><li>load the user ( as we call user_get_id_by_name anyway ) and run the updates only if changes are found</li></ol>

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

dregad

dregad

2012-08-30 09:43

developer   ~0032728

There are a lot of improvements and fixes needed in the LDAP area ;-)

Paul was working on that at some point, but as he's now focusing on his "2.0" branch I'm not sure any of what he implemented is ever going to make it into 1.2 or even 1.3... you may want to take a look at his branch on github.

IMO The specific issue you mention is a consequence (or limitation) of the user API which does not offer primitives to update several fields at once.

We should not have SQL updating the user table in the LDAP API. It may however be an idea to have a new function - or maybe revise user_set_field() - to accept an array of fields/values. I'm sure there are several other places where this could come in handy.

rombert

rombert

2012-08-30 18:24

reporter   ~0032732

I've added a new user_set_fields API call which helps with this performance problem.

dregad

dregad

2012-08-31 10:58

developer   ~0032750

Exactly what I had in mind. Thanks Robert.

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036178

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master bb676ff4

2012-08-30 11:11

rombert


Details Diff
ldap_api: use only one SQL call to update user profile

Fixes 0014673: LDAP login performs unnecessary SQL updates
Affected Issues
0014673
mod - core/ldap_api.php Diff File

MantisBT: master-1.2.x ab63d69a

2012-08-30 11:11

rombert


Details Diff
ldap_api: use only one SQL call to update user profile

Fixes 0014673: LDAP login performs unnecessary SQL updates
Affected Issues
0014673
mod - core/ldap_api.php Diff File