~openerp-community/openobject-addons/6.0_bug_801562

« back to all changes in this revision

Viewing changes to users_ldap/users_ldap.py

  • Committer: Olivier Dony
  • Date: 2011-06-16 16:03:17 UTC
  • Revision ID: odo@openerp.com-20110616160317-4hfw5e360e600pgq
[FIX] users_ldap: consistent handling of login() vs check()

Explicit check for blank passwords was introduced recently
in check() for bug 760301, but login() did not behave the same
so the resulting error message would be inconsistent.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
class users(osv.osv):
67
67
    _inherit = "res.users"
68
68
    def login(self, db, login, password):
 
69
 
 
70
        if not password:
 
71
            # empty passwords are disallowed for obvious security reasons
 
72
            return False
 
73
 
69
74
        ret = super(users,self).login(db, login, password)
70
75
        if ret:
71
76
            return ret