Example #1
0
            $module = $dRep->getModule(array('cmsIndex' => 2));
        }
        //we have user, check if we have a site, if not, redirect
    }
    if (isset($module)) {
        if (!isset($router) || strpos(strtolower($router->getControllername()), strtolower($module->getRoute())) === false) {
            //make sure we can access actions on the allowed module by not defaulting to index
            $router = new Router($module->getRoute());
        }
    }
    $controller = $router->LoadController($dRep);
    if ($hasUser) {
        $controller->setUser($INK_User);
    }
    /*** run the controller ***/
    $router->RunController($hasUser);
    //print out the page
    $router->printHtml($hasUser);
} catch (AccessException $e) {
    $message['css'] = 'hidden';
    $message['text'] = '';
    $message['icon'] = '';
    if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) {
        try {
            if ($e->getMessage() == 'logout') {
                $fido->kill();
            }
            include_once 'controllers/message.controller.php';
            $messageController = new MessageController($dRep);
            $message = $messageController->getLoginMessage($e);
        } catch (Exception $e) {