Security: check_creds is not really needed, use "check"

The "check" function would not return a False value anyway, so don't use
wrapping one.

bzr revid: p_christ@hol.gr-20090813115126-hv1uz009ltcnid2y
This commit is contained in:
P. Christeas
2009-08-13 14:51:26 +03:00
parent c6e4214daa
commit 7e9d338e7f
+1 -6
View File
@@ -51,7 +51,7 @@ def check_super(passwd):
else:
raise ExceptionNoTb('AccessDenied')
def check_creds(db, uid, passwd):
def check(db, uid, passwd):
if _uid_cache.get(db, {}).get(uid) and _uid_cache.get(db, {}).get(uid) == passwd:
return True
cr = pooler.get_db(db).cursor()
@@ -83,10 +83,5 @@ def access(db, uid, passwd, sec_level, ids):
raise ExceptionNoTb('Bad username or password')
return res[0]
def check(db, uid, passwd):
if not check_creds(db,uid,passwd):
raise ExceptionNoTb('Bad username or password')
pass
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: