Beispiel #1
0
def set_panel_pwd(password, ncli=False):
    import db
    sql = db.Sql()
    result = sql.table('users').where('id=?', (1, )).setField(
        'password', public.password_salt(public.md5(password), uid=1))
    username = sql.table('users').where('id=?', (1, )).getField('username')
    if ncli:
        print("|-%s: " % public.GetMsg("USER_NAME") + username)
        print("|-%s: " % public.GetMsg("NEW_PASS") + password)
    else:
        print(username)
Beispiel #2
0
def set_panel_pwd(password, ncli=False):
    import db
    sql = db.Sql()
    result = sql.table('users').where('id=?', (1, )).setField(
        'password', public.password_salt(public.md5(password), uid=1))
    username = sql.table('users').where('id=?', (1, )).getField('username')
    if ncli:
        print("|-用户名: " + username)
        print("|-新密码: " + password)
    else:
        print(username)