@ -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 :
super ( res_users , self ) . check_credentials ( cr , SUPERUSER_ID , password )
return True
except exceptions . AccessDenied :
if uid != SUPERUSER_ID :
try :
self . check_credentials ( cr , SUPERUSER_ID , password )
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 )