Example #1
0
try {
    try {
        $route = $varChecker->getValue('rt');
        $router = new Router(trim($route, '/'));
    } catch (DataException $e) {
        $module = $dRep->getModule('index');
        $router = new Router($module->getRoute());
    }
    /*** find the module we are looking for ***/
    /*** check if this is a customer **/
    /*** redirect to login if we dont have customer and are not trying to access a module where anon access is allowed **/
    $fido = new Guarddog();
    try {
        $customer = $fido->CheckCustomer();
    } catch (DataException $e) {
        if ($router->getControllername() != '') {
            $module = $dRep->getModule($router->getControllername());
            if (!$module->AllowAnonomousAccess()) {
                throw new CustomerException('wrongcustomer');
            }
            $hasUser = false;
        } else {
            throw new CustomerException('nocustomer');
        }
    }
    /*** check if we have a user **/
    if (!isset($module) || isset($module) && !$module->AllowAnonomousAccess()) {
        $INK_User = $fido->CheckUser();
        try {
            $fido->ResolveUserSite();
        } catch (SiteException $e) {