Get controller class by checking if user has rights to access current controller or not.
@return string
764687
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;
    }
935071
protected function getUserClass()
    {
        if (get_class(auth()) === 'Illuminate\Auth\Guard') {
            return auth() -> getProvider() -> getModel();
        }

        return auth() -> guard() -> getProvider() -> getModel();
    }
988230
public function controllerName($class = null)
    {
        $name = $class ? $class : get_class($this);
        $name = preg_replace('#^('.preg_quote('Bkwld\Decoy\Controllers\\')
            .'|'.preg_quote('App\Http\Controllers\Admin\\').')#', '', $name);

        return $name;
    }
1140
protected function getRequestedControllerKey()
    {
        $return = null;
        $requestedControllerKey = $this->getRequest()->getRequestParameter('oePayPalRequestedControllerKey');
        if (!empty($requestedControllerKey) &&
            \OxidEsales\Eshop\Core\Registry::getControllerClassNameResolver()->getClassNameById($requestedControllerKey)) {
            $return = $requestedControllerKey;
        }
        return $return;
    }
1021032
private function control(){
		if ( $this->file && !isset($this->is_controlled) ){
      $ok = 1;
      if ( $this->plugin ){
        $this->register_plugin_classes($this->plugin_path());
      }
			ob_start();
			foreach ( $this->checkers as $appui_checker_file ){
				// If a checker file returns false, the controller is not processed
				// The checker file can define data and inc that can be used in the subsequent controller
        if ( bbn\mvc::include_controller($appui_checker_file, $this, true) === false ){
					$ok = false;
					break;
				}
			}
      if ( ($log = ob_get_contents()) && \is_string($log) ){
			  $this->obj->content = $log;
      }
      ob_end_clean();
      // If rerouted during the checkers
      if ( $this->is_rerouted ){
        $this->is_rerouted = false;
        return $this->control();
      }
      if ( !$ok ){
        return false;
      }
      $output = bbn\mvc::include_controller($this->file, $this);
      // If rerouted during the controller
      if ( $this->is_rerouted ){
        $this->is_rerouted = false;
        return $this->control();
      }
			if ( \is_object($this->obj) && !isset($this->obj->content) && !empty($output) ){
				$this->obj->content = $output;
			}
      $this->is_controlled = 1;
		}
		return $this->is_controlled ? true : false;
	}
679532
public function getCurrentAction()
    {
        if (! isset($this->actions[$this->position])) return null;

        $define = $this->actions[$this->position];
        if ($define['controller']) return $define;

        $controller = $this->getController($define['controller_name']);
        $define['controller'] = $controller;

        $this->actions[$this->position] = $define;

        return $define;
    }
392840
public function getRequestedControllerName()
    {
        if (isset($this->_routingInfo['requested_controller'])) {
            return $this->_routingInfo['requested_controller'];
        }
        if (($this->_rewritedPathInfo !== null) && isset($this->_rewritedPathInfo[1])) {
            return $this->_rewritedPathInfo[1];
        }
        return $this->getControllerName();
    }
222824
public function currentRouteAction()
    {
        if (! is_null($route = $this->current())) {
            $action = $route->getAction();

            return isset($action['controller']) ? $action['controller'] : null;
        }
    }
1036757
protected function _getControllerClassName($controllerName)
    {
        if ($this->alias->has('@ns.cli')) {
            $controllerClassName = $this->alias->resolveNS('@ns.cli\\' . Text::camelize($controllerName)) . 'Controller';
            if (class_exists($controllerClassName)) {
                return $controllerClassName;
            }
        }

        return 'ManaPHP\\Cli\\Controllers\\' . Text::camelize($controllerName) . 'Controller';
    }
881928
public function getController()
    {
        if (isset($this->uris[0]) && '' !== $this->uris[0]) {
            $_controller = $this->uris[0];
        } else {
            throw new NotFoundException('Cannot dispatch controller name.');
        }

        return strip_tags($_controller);
    }
752220
public function hasController()
    {
        return $this->def->getService() !== null &&
            $this->def->getService()->getRouterBase() !== null;
    }
768318
private function guessControllerClass()
	{
		$calledClass = get_called_class();

		if (($pos = strpos($calledClass, 'Config')) !== false
				&& $pos === (strlen($calledClass) - 6)
				&& class_exists(($className = substr($calledClass, 0, -6)))) {

			return $className;
		}

		return  '\Supra\Package\Cms\Pages\Block\DefaultBlockController';
	}
1220952
public function getControllerClass()
    {
        $controller = array_get($this->routeParams, 'controller');
        $match      = null;
        if (!preg_match('/(.*?)(?=@|$)/', $controller, $match)) {
            return;
        }
        return $match[0];
    }
1351529
protected function getControllerContent()
    {
        if (!$stub = $this->getControllerStub()) {
            return '';
        }

        $sectionSegmentsStudly = $this->sectionSegmentsStudly;

        $name      = array_pop($sectionSegmentsStudly).'Controller';
        $namespace = $this->appNs.'\Http\Controllers';
        $requestNs = $this->appNs.'\Http\Requests\\'.implode('\\', $this->sectionSegmentsStudly);
        $listingClass = $this->appNs.'\Listings\\'.implode('\\', $this->sectionSegmentsStudly).'Listing';

        if ($sectionSegmentsStudly) {
            $namespace .= '\\'.implode('\\', $sectionSegmentsStudly);
        }

        return strtr($stub, array_merge($this->getCommonReplacements(), [
            '{{namespace}}'        => $namespace,
            '{{name}}'             => $name,
            '{{requestNamespace}}' => $requestNs,
            '{{listingClass}}'     => $listingClass,
        ]));
    }
747752
public function getControllerClasses()
    {
        $moduleName = $this->getVarValue('moduleName', false);
    
        return (empty($moduleName) || !Yii::$app->hasModule($moduleName)) ? [] : Yii::$app->getModule($moduleName)->getControllerFiles();
    }
531814
public function getActionName()
    {
        $callableName = null;

        if ($this->isControllerAction()) {
            return $this->controllerName . '@' . $this->controllerMethod;
        }

        if (is_callable($this->callable, false, $callableName)) {
            list($controller, $method) = explode('::', $callableName);

            if ($controller === 'Closure') {
                return $controller;
            }

            return $controller . '@' . $method;
        }
    }
124581
protected function getController()
    {
        list($class) = explode('@', $this->action['uses']);
        if (!$this->controller) {
            $this->controller = $this->container->make($class);
        }

        return $this->controller;
    }