protected function calculateControllerClassFromRights()
    {
        $this->user(); //init user first;
        $controllerClass = $this->getControllerClassFromNameAndModule($this->request()->getController(), $this->request()->getModule());
        if (!trim($this->request()->getAction())) {
            $ctrl = new $controllerClass;
            /* @var $ctrl \mpf\web\Controller */
            $this->request()->setAction($ctrl->defaultAction);

        }
        if (!class_exists($controllerClass)) {
            if ($this->logMissingPages) {
                $this->alert('Controller ' . $controllerClass . ' not found!', array(
                    'requestedController' => $this->request()->getController(),
                    'requestedModule' => $this->request()->getModule()
                ));
            }
            $controllerClass = $this->getPageNotFound();
        } elseif ($this->accessMap && (!$this->accessMap->canAccess($this->request()->getController(), $this->request()->getAction(), $this->request()->getModule()))) {
            if ($this->user()->isGuest()) { // it's not loggedin , redirect to login page
                $controllerClass = $this->getPageLogin();
            } else { // it's loggedin but doesn't have the rights, redirect to access denied page
                $controllerClass = $this->getPageAccessDenied();
            }
        }
        return $controllerClass;
    }
protected function calculateControllerClassFromRights()
    {
        $this->user(); //init user first;
        $controllerClass = $this->getControllerClassFromNameAndModule($this->request()->getController(), $this->request()->getModule());
        if (!trim($this->request()->getAction())) {
            $ctrl = new $controllerClass;
            /* @var $ctrl \mpf\web\Controller */
            $this->request()->setAction($ctrl->defaultAction);

        }
        if (!class_exists($controllerClass)) {
            if ($this->logMissingPages) {
                $this->alert('Controller ' . $controllerClass . ' not found!', array(
                    'requestedController' => $this->request()->getController(),
                    'requestedModule' => $this->request()->getModule()
                ));
            }
            $controllerClass = $this->getPageNotFound();
        } elseif ($this->accessMap && (!$this->accessMap->canAccess($this->request()->getController(), $this->request()->getAction(), $this->request()->getModule()))) {
            if ($this->user()->isGuest()) { // it's not loggedin , redirect to login page
                $controllerClass = $this->getPageLogin();
            } else { // it's loggedin but doesn't have the rights, redirect to access denied page
                $controllerClass = $this->getPageAccessDenied();
            }
        }
        return $controllerClass;
    }
protected function calculateControllerClassFromRights ( ) { $ this -> user ( ) ; //init user first; $ controllerClass = $ this -> getControllerClassFromNameAndModule ( $ this -> request ( ) -> getController ( ) , $ this -> request ( ) -> getModule ( ) ) ; if ( ! trim ( $ this -> request ( ) -> getAction ( ) ) ) { $ ctrl = new $ controllerClass ; /* @var $ctrl \mpf\web\Controller */ $ this -> request ( ) -> setAction ( $ ctrl -> defaultAction ) ; } if ( ! class_exists ( $ controllerClass ) ) { if ( $ this -> logMissingPages ) { $ this -> alert ( 'Controller ' . $ controllerClass . ' not found!' , array ( 'requestedController' => $ this -> request ( ) -> getController ( ) , 'requestedModule' => $ this -> request ( ) -> getModule ( ) ) ) ; } $ controllerClass = $ this -> getPageNotFound ( ) ; } elseif ( $ this -> accessMap && ( ! $ this -> accessMap -> canAccess ( $ this -> request ( ) -> getController ( ) , $ this -> request ( ) -> getAction ( ) , $ this -> request ( ) -> getModule ( ) ) ) ) { if ( $ this -> user ( ) -> isGuest ( ) ) { // it's not loggedin , redirect to login page $ controllerClass = $ this -> getPageLogin ( ) ; } else { // it's loggedin but doesn't have the rights, redirect to access denied page $ controllerClass = $ this -> getPageAccessDenied ( ) ; } } return $ controllerClass ; }
Get controller class by checking if user has rights to access current controller or not.
@return string
Get controller class by checking if user has rights to access current controller or not .