User LDAP populate does not work with Active Directory

Bug #1203113 reported by Daniel Reis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Therp Addons
New
Undecided
Unassigned

Bug Description

With Active Direcory, the LDAP filter is "sAMAccountName=%".
However, in the code this key is changed to lowercase, "samaccountname", so the lookup on the LDAP result disct can't match the "sAMAccountName" entry.
I got it fixed by removing the ".lower()" at model/users_ldap.pt#55.

Traceback:
  File "/opt/openerp/therp61/main/therp-addons/users_ldap_populate/model/users_ldap.py", line 83, in populate_wizard
    cr, uid, {'ldap_id': ids[0]}, context=context)
  File "/opt/openerp/therp61/main/therp-addons/users_ldap_populate/model/populate_wizard.py", line 40, in create
    cr, uid, vals['ldap_id'], context=context)
  File "/opt/openerp/therp61/main/therp-addons/users_ldap_populate/model/users_ldap.py", line 64, in action_populate
    cr, uid, conf, result[1][login_attr][0], result)
KeyError: u'samaccountname'

Debug:
-> cr, uid, conf, result[1][login_attr][0], result)
(Pdb) p login_attr
u'samaccountname'
(Pdb) p result[1]['samaccountname'][0]
*** KeyError: KeyError('samaccountname',)
(Pdb) p result[1]['sAMAccountName'][0]
'abelps'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.