Example #1
0
        $INK_User = $fido->CheckUser();
        try {
            $fido->ResolveUserSite();
        } catch (SiteException $e) {
            //need to find module with no site
            $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();