def ch_pw(oid,name,opw,npw): opw = make_pw(name,opw) ou = OrdUser.objects(id=ObjectId(oid)).filter(password=opw) if ou: ou = ou.first() ou.password = make_pw(name,npw) ou.save() return True return False
def ch_pw(oid, name, opw, npw): opw = make_pw(name, opw) ou = OrdUser.objects(id=ObjectId(oid)).filter(password=opw) if ou: ou = ou.first() ou.password = make_pw(name, npw) ou.save() return True return False
def reg_user(name,password): password = make_pw(name,password) ou = OrdUser() ou.name = name ou.password = password ou.save() return ou
def reg_user(name, password): password = make_pw(name, password) ou = OrdUser() ou.name = name ou.password = password ou.save() return ou
def login(name,password): password = make_pw(name,password) res = OrdUser.objects(name=name).filter(password=password) if res: return res.first() return False
def login(name, password): password = make_pw(name, password) res = OrdUser.objects(name=name).filter(password=password) if res: return res.first() return False