Beispiel #1
0
def users_add():
    user_data = request.form.to_dict()
    user_data['create_time'] = datetime.now()
    user_data['last_time'] = datetime.now()
    error = db.user_regedit_check(user_data)
    if error['status'] == 0:
        db.user_add(user_data)
    return json.dumps(error)
Beispiel #2
0
def users_add():
    user_data = request.form.to_dict()
    user_data['create_time'] = datetime.now()
    user_data['last_time'] = datetime.now()
    error = db.user_regedit_check(user_data)
    if error['status'] == 0:
        db.user_add(user_data)
    return json.dumps(error)
def users_add():
    user_data = request.form.to_dict()
    user_data['create_time'] = datetime.now()
    user_data['last_time'] = datetime.now()
    flag, error = db.user_regedit_check(user_data)
    if flag:
        if db.user_add(user_data):
            return redirect('/users/userinfo?name=%s' % user_data['name'])
    return render_template('user_create.html', result=error)
Beispiel #4
0
def users_add():
    user_data = request.form.to_dict()
    user_data['create_time'] = datetime.now()
    user_data['last_time'] = datetime.now()
    user_data['password'] = db.calc_md5(user_data['password'])
    user_data['repwd'] = db.calc_md5(user_data['repwd'])
    error = db.user_regedit_check(user_data)
    if error['status'] == 0:
        db.user_add(user_data)
        util.WriteLog('infoLogger').warning('%s add user %s' % (session['username'], user_data['name']))
    return json.dumps(error)
Beispiel #5
0
def users_add():
    user_data = request.form.to_dict()
    user_data['create_time'] = datetime.now()
    user_data['last_time'] = datetime.now()
    user_data['password'] = db.calc_md5(user_data['password'])
    user_data['repwd'] = db.calc_md5(user_data['repwd'])
    error = db.user_regedit_check(user_data)
    if error['status'] == 0:
        db.user_add(user_data)
        util.WriteLog('infoLogger').warning(
            '%s add user %s' % (session['username'], user_data['name']))
    return json.dumps(error)
Beispiel #6
0
def users_add():
    params = request.form
    username = params.get('username')
    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')
    create_time = datetime.now()
    last_time = datetime.now()
    if db.user_regedit_check(username,password,name_cn,email,mobile,role,status,create_time,last_time):
        if db.user_add(username,password,name_cn,email,mobile,role,status,create_time,last_time):
            return redirect('/users')
    return redirect('/users/regedit/')
Beispiel #7
0
def users_add():
    params = request.form
    username = params.get('username')
    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')
    create_time = datetime.now()
    last_time = datetime.now()
    if db.user_regedit_check(username, password, name_cn, email, mobile, role,
                             status, create_time, last_time):
        if db.user_add(username, password, name_cn, email, mobile, role,
                       status, create_time, last_time):
            return redirect('/users')
    return redirect('/users/regedit/')