コード例 #1
0
ファイル: dbm.py プロジェクト: mcrute/pyapache
def update_user(user, passwd, db):
    """ Change the users pass in the DB """
    db_dict = anydbm.open(db, "w")
    if user in db_dict:
        db_dict[user] = htpasswd.hash_password(passwd)
        db_dict.close()
        return True
    else:
        return False
コード例 #2
0
ファイル: dbm.py プロジェクト: mcrute/pyapache
def add_user(user, passwd, db):
    """ Add user to the DB, creating if need be """
    db_dict = anydbm.open(db, "c")
    db_dict[user] = htpasswd.hash_password(passwd)
    db_dict.close()
    return True