diff options
| author | P. Christeas <p_christ@hol.gr> | 2010-12-28 11:48:31 +0200 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2010-12-28 11:48:31 +0200 |
| commit | 6846791c64da3d42cdf1a976059df8ebf42ef855 (patch) | |
| tree | 219c2254c53e0c06c363074b43ec4084d2a256ae /addons/base_crypt | |
| parent | 85f7655cfe1a7de1dc1991c4b61a1916a643d242 (diff) | |
Base_crypt: adapt to security fix of server
bzr revid: p_christ@hol.gr-20101228094831-z6c334w8b15v2xfq
Diffstat (limited to 'addons/base_crypt')
| -rwxr-xr-x | addons/base_crypt/crypt.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py index b52206e80a8..8510f336dee 100755 --- a/addons/base_crypt/crypt.py +++ b/addons/base_crypt/crypt.py @@ -174,8 +174,8 @@ def login(db, login, password): # else: # raise Exception('AccessDenied') -def check(db, uid, passwd): - if security._uid_cache.has_key( uid ) and (security._uid_cache[uid]==passwd): +def check_creds(db, uid, passwd): + if security._uid_cache.get(db, {}).get(uid) and security._uid_cache.get(db, {}).get(uid) == passwd: return True cr = pooler.get_db(db).cursor() if passwd not in _salt_cache: @@ -191,7 +191,7 @@ def check(db, uid, passwd): res = cr.fetchone()[0] cr.close() if not bool(res): - raise Exception('AccessDenied') + raise security.ExceptionNoTb('AccessDenied') if res: security._uid_cache[uid] = passwd return bool(res) @@ -204,14 +204,14 @@ def access(db, uid, passwd, sec_level, ids): res = cr.fetchone() cr.close() if not res: - raise Exception('Bad username or password') + raise security.ExceptionNoTb('Bad username or password') return res[0] # check if module is installed or not security.login=login #security.check_super=check_super security.access=access -security.check=check +security.check_creds=check_creds class users(osv.osv): _name="res.users" |
