Esempio n. 1
0
            ThreadController::create();
        } else {
            if ($_GET[KEY_TARGET] == "createrss") {
                ThreadController::createRSS();
            } else {
                if (empty($_GET[KEY_OTHER_1])) {
                    ThreadController::show($_GET[KEY_TARGET]);
                } else {
                    if ($_GET[KEY_OTHER_1] == "edit") {
                        ThreadController::edit($_GET[KEY_TARGET], $_GET[KEY_TARGET_2]);
                    } else {
                        if ($_GET[KEY_OTHER_1] == "delete") {
                            ThreadController::delete($_GET[KEY_TARGET], $_GET[KEY_TARGET_2]);
                        } else {
                            if ($_GET[KEY_OTHER_1] == "editrss") {
                                ThreadController::editRSS($_GET[KEY_TARGET], $_GET[KEY_TARGET_2]);
                            }
                        }
                    }
                }
            }
        }
    }
} else {
    if ($_GET[KEY_PATH] == "account") {
        // begin
        // if current account is guest account, redirect it to no-permission page
        if ($_GET[KEY_TARGET] != "login" && $_GET[KEY_TARGET] != "signout") {
            if ($_SESSION[KEY_SESSION][Account::KEY_USERNAME] == "guest") {
                Utils::showNoPermissionPage();
                die;
Esempio n. 2
0
});
$routes->get('/thread', function () {
    ThreadController::threadList();
});
$routes->get('/thread/create', 'check_logged_in', function () {
    ThreadController::createThread();
});
$routes->get('/thread/:id', function ($id) {
    ThreadController::showThread($id);
});
$routes->get('/thread/:id/participants', function ($id) {
    ThreadController::participants($id);
});
$routes->get('/thread/:id/edit', function ($id) {
    BaseController::check_thread_rights($id);
    ThreadController::editThread($id);
});
//Messages
$routes->get('/thread/:id/message/create', 'check_logged_in', function ($id) {
    MessageController::createMessage($id);
});
$routes->get('/message/:id/edit', function ($id) {
    BaseController::check_message_rights($id);
    MessageController::editMessage($id);
});
$routes->post('/thread/:thread_id/message', 'check_logged_in', function ($thread_id) {
    MessageController::addMessage($thread_id);
});
$routes->post('/message/:id/update', function ($id) {
    BaseController::check_message_rights($id);
    MessageController::updateMessage($id);