Ejemplo n.º 1
0
 public static function valid($token)
 {
     if (!CSRF::valid($token)) {
         $css_files = array();
         $view = "access_denied";
         \CODOF\Smarty\Layout::load($view, $css_files);
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 public static function tpl($tpl)
 {
     \CODOF\Smarty\Layout::load('file:' . PLUGIN_DIR . $tpl);
 }
Ejemplo n.º 3
0
dispatch_get('/topic/:tid/:tname/:page', function ($tid, $tname, $page) {
    if ($page == null) {
        $page = 1;
    }
    $forum = new \Controller\forum();
    $forum->topic((int) $tid, $page);
    CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files);
});
dispatch_get('/new_topic', function () {
    $forum = new \Controller\forum();
    $forum->manage_topic();
    CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files);
});
dispatch_get('/tags/:tag/:page', function ($tag, $page = 1) {
    if (!isset($tag)) {
        return \CODOF\Smarty\Layout::not_found();
    }
    CODOF\Store::set('meta:robots', 'noindex, follow');
    $clean_tag = strip_tags($tag);
    $forum = new Controller\forum();
    $forum->listTaggedTopics($clean_tag, $page);
    CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files);
});
//-------------INDEX------------------------------------------------------------
dispatch_get('/', function () {
    global $installed;
    if (!$installed) {
        $url = str_replace("index.php?u=/", "", RURI);
        header("Location: " . $url . "install/index.php");
    }
    $forum = new \Controller\forum();