Example #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
Example #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
Example #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)
Example #4
0
def lock_inter(username):
    user_dict = db_handler.check_usernam(username)
    user_dict["lock"] = True
    db_handler.save(user_dict)
Example #5
0
def chang_inter(username, balance):
    user_dict = db_handler.check_usernam(username)
    user_dict["balance"] = float(balance)
    db_handler.save(user_dict)
Example #6
0
def unlock_inter(username):
    user_dict = db_handler.check_usernam(username)
    user_dict["lock"] = False
    db_handler.save(user_dict)
Example #7
0
def check_lock(username):
    user_dict = db_handler.check_usernam(username)

    if user_dict["lock"]:
        return True
Example #8
0
def check_flow_inter(username):
    user_dict = db_handler.check_usernam(username)
    flow = user_dict["flow"]
    return flow
Example #9
0
def check_username(input_name):
    user_dict = db_handler.check_usernam(input_name)
    if user_dict:
        return True
Example #10
0
def check_bal_inter(input_name):
    bal = db_handler.check_usernam(input_name)["balance"]
    return bal
Example #11
0
def get_shop_car(username):
    user_dict = db_handler.check_usernam(username)
    shop_car = user_dict["shop_car"]
    return shop_car
Example #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)