Esempio n. 1
0
def login(input_name, input_pwd):
    user_dict = db_handler.check_usernam(input_name)

    pwd = comment.get_md(input_pwd)

    if pwd == user_dict["pwd"]:
        return True
Esempio n. 2
0
def login(input_name,input_pwd):
    user_dict = db_handler.check_usernam(input_name)
    md = md5()
    md.update(b"shop")
    md.update(input_pwd.encode("utf-8"))
    input_pwd = md.hexdigest()

    if input_pwd == user_dict["pwd"]:
        return True
Esempio n. 3
0
def save_shop_car(username,shop_car):
    user_dict = db_handler.check_usernam(username)
    old_shop_car = user_dict["shop_car"]

    for i,j in shop_car.items():
        if old_shop_car.get(i):
            old_shop_car[i] += j
        else:
            old_shop_car[i] = j
    user_dict["shop_car"].update(old_shop_car)

    db_handler.save(user_dict)
Esempio n. 4
0
def lock_inter(username):
    user_dict = db_handler.check_usernam(username)
    user_dict["lock"] = True
    db_handler.save(user_dict)
Esempio n. 5
0
def chang_inter(username, balance):
    user_dict = db_handler.check_usernam(username)
    user_dict["balance"] = float(balance)
    db_handler.save(user_dict)
Esempio n. 6
0
def unlock_inter(username):
    user_dict = db_handler.check_usernam(username)
    user_dict["lock"] = False
    db_handler.save(user_dict)
Esempio n. 7
0
def check_lock(username):
    user_dict = db_handler.check_usernam(username)

    if user_dict["lock"]:
        return True
Esempio n. 8
0
def check_flow_inter(username):
    user_dict = db_handler.check_usernam(username)
    flow = user_dict["flow"]
    return flow
Esempio n. 9
0
def check_username(input_name):
    user_dict = db_handler.check_usernam(input_name)
    if user_dict:
        return True
Esempio n. 10
0
def check_bal_inter(input_name):
    bal = db_handler.check_usernam(input_name)["balance"]
    return bal
Esempio n. 11
0
def get_shop_car(username):
    user_dict = db_handler.check_usernam(username)
    shop_car = user_dict["shop_car"]
    return shop_car
Esempio n. 12
0
def shop_pay(username,cost):
    pay_inter(username,cost)
    user_dict = db_handler.check_usernam(username)
    user_dict["shop_car"] = {}
    db_handler.save(user_dict)