Exemplo n.º 1
0
$app->post('/contest/:id/register', function ($id) {
    fAuthorization::requireLoggedIn();
    User::requireEmailVerified();
    $controller = new ReportController();
    $controller->newRegistration($id);
});
$app->post('/contest/:id/question', function ($id) {
    fAuthorization::requireLoggedIn();
    User::requireEmailVerified();
    $controller = new ReportController();
    $controller->newQuestion($id);
});
$app->post('/question/:id/reply', function ($id) {
    fAuthorization::requireLoggedIn();
    $controller = new ReportController();
    $controller->replyQuestion($id);
});
$app->post('/question/:id/toggle', function ($id) {
    fAuthorization::requireLoggedIn();
    $controller = new ReportController();
    $controller->toggleQuestionVisibility($id);
});
$app->get('/polling/:secret', function ($secret) {
    if (JUDGER_SECRET != $secret) {
        exit;
    }
    $controller = new PollingController();
    $opcode = fRequest::get('opcode', 'string');
    if ($opcode == 'fetchRecord') {
        $controller->fetchRecord();
    } else {