Exemple #1
0
def cmd_panel(username):
    if app.config['TEST_MODE']:
        tm = "Yes"
    else:
        tm = "No"
    if g.state in state_str:
        ststr = state_str[g.state]
    else:
        ststr = '???' + g.state
    ststr += '(en=%d)' % timekeeper.get_enabled()
    return render_template('cmd.html',
                           login=url_for('login'),
                           logout=url_for('logout'),
                           password=url_for('user_password',
                                            username=username),
                           whoami=url_for('whoami'),
                           myq=url_for('get_user_q_list', username=username),
                           qlist=url_for('q_get_list'),
                           alist=url_for('admin_A_username',
                                         username=username),
                           posta=url_for('a_q_menu', username=username),
                           checkq=url_for('q_check'),
                           userlist=url_for('admin_user_list_get'),
                           me=url_for('admin_user_get', username=username),
                           score=url_for('get_score'),
                           testmode=tm,
                           state=ststr)
Exemple #2
0
def cmd_panel(username):
    if app.config['TEST_MODE']:
        tm = "Yes"
    else:
        tm = "No"
    if g.state in state_str:
        ststr = state_str[g.state]
    else:
        ststr = '???'+g.state
    ststr += '(en=%d)' % timekeeper.get_enabled()
    return render_template('cmd.html',
                           login=url_for('login'),
                           logout=url_for('logout'),
                           password=url_for('user_password', username=username),
                           whoami=url_for('whoami'),
                           myq=url_for('get_user_q_list', username=username),
                           qlist=url_for('q_get_list'),
                           alist=url_for('admin_A_username', username=username),
                           posta=url_for('a_q_menu', username=username),
                           checkq=url_for('q_check'),
                           userlist=url_for('admin_user_list_get'),
                           me=url_for('admin_user_get', username=username),
                           score=url_for('get_score'),
                           testmode=tm,
                           state=ststr)
Exemple #3
0
def admin_timekeeper():
    "timekeeperの有効、無効"
    if not priv_admin():
        return adc_response("access forbidden", request_is_json(), 403)
    if request.method == 'GET':
        val = timekeeper.get_enabled()
        msg = "enabled=" + str(val)
        return adc_response(msg, request_is_json())
    # PUTの場合
    val = request.data
    if val.isdigit():
        val = int(val)
        ret = timekeeper.set_enabled(val)
        msg = "enabled=" + str(ret)
        return adc_response(msg, request_is_json())
Exemple #4
0
def admin_timekeeper():
    "timekeeperの有効、無効"
    if not priv_admin():
        return adc_response("access forbidden", request_is_json(), 403)
    if request.method == 'GET':
        val = timekeeper.get_enabled()
        msg = "enabled=" + str(val)
        return adc_response(msg, request_is_json())
    # PUTの場合
    val = request.data
    if val.isdigit():
        val = int(val)
        ret = timekeeper.set_enabled(val)
        msg = "enabled=" + str(ret)
        return adc_response(msg, request_is_json())