Ejemplo n.º 1
0
def users_update():
    if request.method == 'POST':
        user_data = request.form.to_dict()
        db.user_update(user_data)
        return redirect('/users/')
    id = request.args.get('id')
    user = db.get_user_by_id(id)
    return render_template('user_modify.html', user=user)
Ejemplo n.º 2
0
def users_update():
    if request.method == 'POST':
        user_data = request.form.to_dict()
        db.user_update(user_data)
        return json.dumps({"status":0, "msg":"update success!"})
        # return redirect('/users/')
    id = request.args.get('id')
    user = db.get_user_by_id(id)
    return render_template('user_modify.html', user=user, session={'user': session.get('username')})
Ejemplo n.º 3
0
def users_update():
    if request.method == 'POST':
        user_data = request.form.to_dict()
        db.user_update(user_data)
        return json.dumps({"status":0, "msg":"update success!"})
        # return redirect('/users/')
    id = request.args.get('id')
    user = db.get_user_by_id(id)
    return render_template('user_modify.html', user=user, session={'user': session.get('username')})
Ejemplo n.º 4
0
def users_update():
    params = request.form
    password = params.get('password')
    name_cn = params.get('name_cn')
    email = params.get('email')
    mobile = params.get('mobile')
    role = params.get('role')
    status = params.get('status')
    db.user_update(password,name_cn,email,mobile,role,status)
    return redirect('/users/')
Ejemplo n.º 5
0
def users_update():
    params = request.form
    password = params.get('password')
    name_cn = params.get('name_cn')
    email = params.get('email')
    mobile = params.get('mobile')
    role = params.get('role')
    status = params.get('status')
    db.user_update(password, name_cn, email, mobile, role, status)
    return redirect('/users/')
Ejemplo n.º 6
0
def users_update():
    if request.method == 'GET':
        id = request.args.get('id')
        user = db.get_user_by_id(id)
        user.pop('create_time')
        user.pop('last_time')
        return json.dumps(dict(user))
    else:
        userinfo = request.form.to_dict()
        data = db.user_update(userinfo['name'], userinfo)
        return json.dumps(data)
Ejemplo n.º 7
0
def users_update():
    if request.method == 'GET':
        id = request.args.get('id')
        user = db.get_user_by_id(id)
        user.pop('create_time')
        user.pop('last_time')
        return json.dumps(dict(user))
    else:
        userinfo = request.form.to_dict()
        data = db.user_update(userinfo['name'], userinfo)
        util.WriteLog('infoLogger').info('%s changed userinfo %s' % (session['username'], userinfo['name']))
        return json.dumps(data)
Ejemplo n.º 8
0
def users_update():
    if request.method == 'GET':
        id = request.args.get('id')
        user = db.get_user_by_id(id)
        user.pop('create_time')
        user.pop('last_time')
        return json.dumps(dict(user))
    else:
        userinfo = request.form.to_dict()
        data = db.user_update(userinfo['name'], userinfo)
        util.WriteLog('infoLogger').info(
            '%s changed userinfo %s' % (session['username'], userinfo['name']))
        return json.dumps(data)
Ejemplo n.º 9
0
def user_edit_profile(member, new_email=None, new_mobile=None):
    if new_email is not None:
        member['email'] = new_email
    if new_mobile is not None:
        member['mobile'] = new_mobile
    return db.user_update(member)
Ejemplo n.º 10
0
def user_change_password(member, new_password):
    member['passwd'] = new_password
    return db.user_update(member)