Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
def reg_user(name,password):
    password = make_pw(name,password)
    ou = OrdUser()
    ou.name = name
    ou.password = password
    ou.save()
    return ou
Beispiel #4
0
def reg_user(name, password):
    password = make_pw(name, password)
    ou = OrdUser()
    ou.name = name
    ou.password = password
    ou.save()
    return ou
Beispiel #5
0
def login(name,password):
    password = make_pw(name,password)
    res = OrdUser.objects(name=name).filter(password=password)
    if res:
        return res.first()
    return False
Beispiel #6
0
def login(name, password):
    password = make_pw(name, password)
    res = OrdUser.objects(name=name).filter(password=password)
    if res:
        return res.first()
    return False