예제 #1
0
def userlist():
    if request.method == "POST":
        queryuser = db.get_by_name(request.form.get('name'))
	return render_template('admin.html',users=db.get_by_all(),queryinfo=queryuser)
    else:
	queryuser = db.get_by_name(request.form.get('name'))
        return render_template('admin.html',users=db.get_by_all(),queryinfo=queryuser)
예제 #2
0
def get_room(name):
    if request.json and 'limit' in request.json:
        limit = request.json.get('limit', 48)
    else:
        limit = 48
    room = db.get_by_name(name, limit)
    if room == 1:
        return make_response(jsonify({'error': 'Room not found.'}), 404)
    if room == 2:
        return make_response(jsonify({'error': 'No data found for room.'}),
                             204)
    return jsonify(room)
예제 #3
0
def index():
    if request.method == "POST":
        name = request.form.get('name')
        password = request.form.get('password')
        if db.check_login_name(name) == True:
            if db.get_by_name(name)['password'] == password:
                return render_template('login.html', info='login ok !!!')
            else:
                return render_template('login.html', info='password error')
        else:
            return render_template('login.html', info='user not fond')
    else:
        return render_template('login.html')