Example #1
0
def change_user_password():
    uid = request.form.get('userid')
    mpasswd = request.form.get('mgr-passwd')
    npasswd = request.form.get('user-passwd-new')
    _is_ok, _error = user.validate_change_user_password(uid, npasswd, session['user']['username'], mpasswd)
    if _is_ok:
        user.change_user_password(uid, npasswd)
    return json.dumps({'is_ok': _is_ok, 'error':_error})
Example #2
0
def change_user_password():
    uid = request.form.get('userid')
    mpasswd = request.form.get('mgr-passwd')
    npasswd = request.form.get('user-passwd')
    _is_ok, _error = user.validate_change_user_password(
        uid, npasswd, session['user']['username'], mpasswd)
    if _is_ok:
        user.change_user_password(uid, npasswd)
    return json.dumps({'is_ok': _is_ok, 'error': _error})
Example #3
0
def change_user_password():
    uid = request.form.get('userid')
    manager_password = request.form.get('manager-password')
    user_password = request.form.get('password')
    print user_password
    _is_ok, _error = user.validate_change_user_password(uid,user_password,session['user']['username'],manager_password)
    if _is_ok:
        user.change_user_password(uid, user_password)
    return json.dumps({'_is_ok':_is_ok, 'error':_error})
Example #4
0
def user_changepwd():
    if request.method == 'GET':
        return render_template('user_changepwd.html')
    uid = request.form.get('uid')
    old_passwd = request.form.get('old_passwd')
    new_passwd = request.form.get('new_passwd')
    if change_user_password(uid, old_passwd, new_passwd):
        flash(u'成功修改用户ID值为%s的账号密码' % uid)
        return redirect('/user/list/')
    else:
        flash(u'修改密码失败' % uid)
        return redirect('/user/list/')