[IMP] 'auth_admin_passkey' works now indepently from the order of the installation of modules 'auth_admin_passkey' and 'auth_crypt'. (Courtesy of Stefan Rijnhart).
parent
bdb535c057
commit
aca963fac4
|
@ -23,13 +23,6 @@ Technical informations :
|
||||||
Limits :
|
Limits :
|
||||||
--------
|
--------
|
||||||
* For the moment, this module doesn't manage translations for the mails;
|
* For the moment, this module doesn't manage translations for the mails;
|
||||||
* This module is compatible with 'auth_crypt' depending of the order of the installation:
|
|
||||||
* if 'auth_crypt' is first installed, it will work;
|
|
||||||
* if 'auth_admin_passkey' is first installed, it won't work;
|
|
||||||
If you want to install 'auth_crypt', please uninstall 'auth_admin_passkey' and
|
|
||||||
reinstall it after the installation of 'auth_crypt'.
|
|
||||||
|
|
||||||
Otherwise, you can propose the merge of a glue module that manage this case.
|
|
||||||
|
|
||||||
Copyright and Licence :
|
Copyright and Licence :
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
|
@ -56,7 +56,6 @@ class res_users(Model):
|
||||||
"""password as you.</pre>""" %(login_user)
|
"""password as you.</pre>""" %(login_user)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
### Overload Section
|
### Overload Section
|
||||||
def authenticate(self, db, login, password, user_agent_env):
|
def authenticate(self, db, login, password, user_agent_env):
|
||||||
""" Authenticate the user 'login' is password is ok
|
""" Authenticate the user 'login' is password is ok
|
||||||
|
@ -88,9 +87,11 @@ class res_users(Model):
|
||||||
|
|
||||||
def check_credentials(self, cr, uid, password):
|
def check_credentials(self, cr, uid, password):
|
||||||
""" Return now True if credentials are good OR if password is admin password"""
|
""" Return now True if credentials are good OR if password is admin password"""
|
||||||
try:
|
if uid != SUPERUSER_ID:
|
||||||
super(res_users, self).check_credentials(cr, SUPERUSER_ID, password)
|
try:
|
||||||
return True
|
self.check_credentials(cr, SUPERUSER_ID, password)
|
||||||
except exceptions.AccessDenied:
|
return True
|
||||||
|
except exceptions.AccessDenied:
|
||||||
|
return super(res_users, self).check_credentials(cr, uid, password)
|
||||||
|
else:
|
||||||
return super(res_users, self).check_credentials(cr, uid, password)
|
return super(res_users, self).check_credentials(cr, uid, password)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue