[6.0] users_ldap does not set last login date and allows login of inactive users

Bug #784501 reported by Stéphane Bidoul (Acsone)
270
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP's Framework R&D

Bug Description

Hello,

When using the users_ldap module, the last login date is not set for users authenticating against ldap.

Additionally, the active flag is not checked, allowing users that are marked inactive in the openerp database to login provided they have valid LDAP credentials.

Proposed patch attached.

Best regards,

-sbi

Related branches

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

I attach an improved patch (the previous one was missing a commit).

Note that I've not tested the interaction with the create_users option. If create_user is set, when connecting as an inactive user, the system will attempt to create another user and it will fail due to the unique_key constraint on login.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hello Stéphane,

Thanks for reporting and providing a patch! You're right about the bug, but I think the issue is greatly mitigated by the fact that if you are using LDAP authentication, you are supposed to manage the authentication policy at the LDAP level. OpenERP only delegates to it. So if you want to disable a user, you should do it at LDAP level. This is why I'm setting the importance to Medium.

However I agree it would be expected by most people that you can prevent a LDAP user from logging in by disabling it in OpenERP as well, so we should fix that.

No question for the last login date of course.

Now we'll have to improve the patch to handle the case where the user is disabled in OpenERP and not in LDAP, as you said, because I think the auto-creation would fail due to uniqueness of logins, leading to stranger errors.

Thanks!

Changed in openobject-addons:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Medium
status: New → Confirmed
visibility: private → public
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

seems to be fixed with lp~openerp-community/openobject-addons/stefan-therp_lp794584 marking it as fix commited.

Thanks

Changed in openobject-addons:
status: Confirmed → Fix Committed
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

A fix for this issue is included in the recently merged branch from Stefan Rijnhart (Therp), which landed at revision 5520
revid: <email address hidden>.

Thanks for reporting and thanks to Stefan for the great work!

Changed in openobject-addons:
milestone: none → 6.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

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