Check LoginDeniedConfiguration.

@param TypoScriptFrontendController $frontendController
@param string                       $uri
@param array                        $explanation
@param bool                         $skipProcessing
3503
public function checkRule(TypoScriptFrontendController $frontendController, string $uri, array &$explanation, bool &$skipProcessing)
    {
        $name = 'sendCacheHeaders_onlyWhenLoginDeniedInBranch';
        $loginDeniedCfg = (!$frontendController->config['config'][$name] || !$frontendController->loginAllowedInBranch);
        if (!$loginDeniedCfg) {
            $explanation[__CLASS__] = 'LoginDeniedCfg is true';
        }
    }
1119349
public function initializeFrontEndRendering($pageId = 0, $type = 0)
    {
        if (array_key_exists('TSFE', $GLOBALS) && is_object($GLOBALS['TSFE']->tmpl)) {
            // FE is already initialized - this can happen when we use/call internal REST-endpoints inside of a normal TYPO3-page
            $this->isFrontEndRenderingInitialized = true;
        }
        if ($this->isFrontEndRenderingInitialized === true) {
            return;
        }

        $GLOBALS['TT'] = new NullTimeTracker();

        if ($this->isFrontEndUserInitialized === false) {
            $this->initializeFrontEndUser($pageId, $type);
        }

        EidUtility::initTCA();

        $tsfe = $this->getTsfe($pageId, $type);
        $tsfe->determineId();
        $tsfe->initTemplate();
        $tsfe->getConfigArray();
        $tsfe->newCObj();
        $tsfe->calculateLinkVars();
        $this->isFrontEndRenderingInitialized = true;
    }
424168
public function frontControllerPath($sitePath, $siteName, $uri)
    {
        if ($uri === '/install.php') {
            return $sitePath.'/web/install.php';
        }

        if (0 === strncmp($uri, '/app_dev.php', 12)) {
            $_SERVER['SCRIPT_NAME'] = '/app_dev.php';
            $_SERVER['SCRIPT_FILENAME'] = $sitePath.'/app_dev.php';

            return $sitePath.'/web/app_dev.php';
        }

        return $sitePath.'/web/app.php';
    }
1166925
public function execute(Framework $framework, WebRequest $request, Response $response)
    {
        // Prepare the page
        $this->setTitle($this->translate('Profile', '\\Zepi\\Web\\AccessControl'));
        $menuEntry = $this->activateMenuEntry();
        
        $overviewPage = $this->getOverviewPageRenderer()->render($framework, $menuEntry);
        
        // Display logout message
        $response->setOutput($this->render('\\Zepi\\Web\\AccessControl\\Templates\\Profile', array(
            'overviewPage' => $overviewPage
        )));
    }
547951
private static function _mainDispatcher($uri, $config) {
        $uriInfo = self::analizeUri();
        $uri = $uriInfo['uri'];
        $uriItems = explode('/', $uri);
        $attributes = [];

        foreach ($config['routes'] as $routePattern => $className) {
            if (preg_match('#' . $routePattern . '#', $uri)) {
                $class = $className;
                $itemCount = count(explode('/', str_replace('\\/', '/', $routePattern)));

                for ($i = 0; $i < $itemCount; $i++) {
                    unset($uriItems[$i]);
                }
                $attributes = array_values($uriItems);
                break;
            }
        }

        if (!$class) {
            $class = self::_getController($uri, 'App\\');
            $classUri = self::_getControllerBaseUri($class);
            
            if(strpos($uri, $classUri) === 0 && strlen($uri) > strlen($classUri)) {
                $attributesUri = substr($uri, strlen($classUri)+1);
                $attributes = explode('/', $attributesUri);
            }
        }
        
        return [
            'class' => self::fixNamespace($class ? $class : self::_getController($uri, 'App\\')),
            'method' => strtolower($_SERVER['REQUEST_METHOD']),
            'attributes' => $attributes
        ];
    }
474341
public function frontControllerPath($sitePath, $siteName, $uri)
    {
        $_SERVER['PHP_SELF']    = $uri;
        $_SERVER['SERVER_ADDR'] = '127.0.0.1';
        $_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
		
        $dynamicCandidates = [
            $this->asActualFile($sitePath, $uri),
            $this->asPhpIndexFileInDirectory($sitePath, $uri),
            $this->asHtmlIndexFileInDirectory($sitePath, $uri),
        ];

        foreach ($dynamicCandidates as $candidate) {
            if ($this->isActualFile($candidate)) {
                $_SERVER['SCRIPT_FILENAME'] = $candidate;
                $_SERVER['SCRIPT_NAME'] = str_replace($sitePath, '', $candidate);
                $_SERVER['DOCUMENT_ROOT'] = $sitePath;
                return $candidate;
            }
        }

        $fixedCandidatesAndDocroots = [
            $this->asRootPhpIndexFile($sitePath) => $sitePath,
            $this->asPublicPhpIndexFile($sitePath) => $sitePath . '/public',
            $this->asPublicHtmlIndexFile($sitePath) => $sitePath . '/public',
        ];

        foreach ($fixedCandidatesAndDocroots as $candidate => $docroot) {
            if ($this->isActualFile($candidate)) {
                $_SERVER['SCRIPT_FILENAME'] = $candidate;
                $_SERVER['SCRIPT_NAME'] = '/index.php';
                $_SERVER['DOCUMENT_ROOT'] = $docroot;
                return $candidate;
            }
        }
    }
137529
public function onBeforeInit()
    {
        $canEdit        = FrontendEditing::ShowAdmin();
        $editingEnabled = FrontendEditing::editingEnabled();
        $minExt         = (Director::isDev()) ? "" : ".min";

        if ($canEdit) {
            // Enable front-end fly-out menu
            // 
            //Flexslider imports easing, which breaks?
            Requirements::block('flexslider/javascript/jquery.easing.1.3.js');

            Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
            Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery-ui/jquery-ui.js');
            Requirements::javascript(FRAMEWORK_ADMIN_DIR.'/javascript/ssui.core.js');
            Requirements::javascript(THIRDPARTY_DIR.'/jquery-entwine/dist/jquery.entwine-dist.js');
            Requirements::javascriptTemplate(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndAdminTemplate'.$minExt.'.js', $this->getConfig($this->owner->data()));
            Requirements::css(FRAMEWORK_DIR.'/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndAdmin'.$minExt.'.js');
            Requirements::css(FRONTEND_ADMIN_DIR.'/css/frontend-admin'.$minExt.'.css');

            $this->owner->getResponse()->addHeader("X-DynamicCache-OptOut", true);
        }
        if ($canEdit && $editingEnabled) {
            // Disable mode pagespeed while editing
            $this->owner->getResponse()->addHeader("PageSpeed", "off");
            // Disable HTTP cache while editing
            HTTP::set_cache_age(0);
            // Enable TinyMCE when editing has been enabled
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/bower_components/tinymce/jquery.tinymce.min.js');
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndEditor'.$minExt.'.js');
            Requirements::css(FRONTEND_ADMIN_DIR.'/css/frontend-editor'.$minExt.'.css');
        }
    }
555283
public function beforeDispatch(
        \Magento\Framework\App\FrontControllerInterface $subject,
        \Magento\Framework\App\RequestInterface $request
    ) {
        $code = $request->getParam(static::REQ_REFERRAL);
        if (!empty($code)) {
            $this->session->logout();
        }
        $this->hlpRefCode->processHttpRequest($code);
    }
880663
public function startAuthentication(Request $request, Response $response)
    {
        if (isset($this->options['routeValues'])) {
            $routeValues = $this->options['routeValues'];
            if (!is_array($routeValues)) {
                throw new MissingConfigurationException(sprintf('The configuration for the WebRedirect authentication entry point is incorrect. "routeValues" must be an array, got "%s".', gettype($routeValues)), 1345040415);
            }
            $actionRequest = new ActionRequest($request);
            $this->uriBuilder->setRequest($actionRequest);

            $actionName = $this->extractRouteValue($routeValues, '@action');
            $controllerName = $this->extractRouteValue($routeValues, '@controller');
            $packageKey = $this->extractRouteValue($routeValues, '@package');
            $subPackageKey = $this->extractRouteValue($routeValues, '@subpackage');
            $uri = $this->uriBuilder->setCreateAbsoluteUri(true)->uriFor($actionName, $routeValues, $controllerName, $packageKey, $subPackageKey);
        } elseif (isset($this->options['uri'])) {
            $uri = strpos($this->options['uri'], '://') !== false ? $this->options['uri'] : $request->getBaseUri() . $this->options['uri'];
        } else {
            throw new MissingConfigurationException('The configuration for the WebRedirect authentication entry point is incorrect or missing. You need to specify either the target "uri" or "routeValues".', 1237282583);
        }

        $response->setContent(sprintf('<html><head><meta http-equiv="refresh" content="0;url=%s"/></head></html>', htmlentities($uri, ENT_QUOTES, 'utf-8')));
        $response->setStatus(303);
        $response->setHeader('Location', $uri);
    }
1172344
public function login($sIdentifier, $sPassword, $bRemember = false)
    {
        //  Delay execution for a moment (reduces brute force efficiently)
        if (Environment::not(Environment::ENV_DEV)) {
            usleep($this->aBruteProtection['delay']);
        }

        // --------------------------------------------------------------------------

        if (empty($sIdentifier) || empty($sPassword)) {
            $this->setError(lang('auth_login_fail_missing_field'));
            return false;
        }

        // --------------------------------------------------------------------------

        //  Look up the user, how we do so depends on the login mode that the app is using
        $oUserModel = Factory::model('User', 'nails/module-auth');
        switch (APP_NATIVE_LOGIN_USING) {

            case 'EMAIL':
                $oUser = $oUserModel->getByEmail($sIdentifier);
                break;

            case 'USERNAME':
                $oUser = $oUserModel->getByUsername($sIdentifier);
                break;

            default:
                if (valid_email($sIdentifier)) {
                    $oUser = $oUserModel->getByEmail($sIdentifier);
                } else {
                    $oUser = $oUserModel->getByUsername($sIdentifier);
                }
                break;
        }

        // --------------------------------------------------------------------------

        if ($oUser) {

            //  User was recognised; validate credentials
            $oPasswordModel = Factory::model('UserPassword', 'nails/module-auth');
            if ($oPasswordModel->isCorrect($oUser->id, $sPassword)) {

                //  Password accepted! Final checks...

                //  Exceeded login count, temporarily blocked
                if ($oUser->failed_login_count >= $this->aBruteProtection['limit']) {
                    //  Check if the block has expired
                    if (time() < strtotime($oUser->failed_login_expires)) {
                        $iBlockTime = ceil($this->aBruteProtection['expire'] / 60);
                        $this->setError(lang('auth_login_fail_blocked', $iBlockTime));
                        return false;
                    }
                }

                //  Reset user's failed login counter and allow login
                $oUserModel->resetFailedLogin($oUser->id);

                /**
                 * If two factor auth is enabled then don't _actually_ set login data the
                 * next process will confirm the login and set this.
                 */

                $oConfig = Factory::service('Config');

                if (!$oConfig->item('authTwoFactorMode')) {

                    //  Set login data for this user
                    $oUserModel->setLoginData($oUser->id);

                    //  If we're remembering this user set a cookie
                    if ($bRemember) {
                        $oUserModel->setRememberCookie($oUser->id, $oUser->password, $oUser->email);
                    }

                    //  Update their last login and increment their login count
                    $oUserModel->updateLastLogin($oUser->id);
                }

                return $oUser;

                //  Is the password null? If so it means the account was created using an API of sorts
            } elseif (is_null($oUser->password)) {

                switch (APP_NATIVE_LOGIN_USING) {

                    case 'EMAIL':
                        $sIdentifier = $oUser->email;
                        break;

                    case 'USERNAME':
                        $sIdentifier = $oUser->username;
                        break;

                    default:
                        $sIdentifier = $oUser->email;
                        break;
                }

                $error = lang('auth_login_fail_social', site_url('auth/password/forgotten?identifier=' . $sIdentifier));
                $this->setError($error);

                return false;

            } else {

                //  User was recognised but the password was wrong
                //  Increment the user's failed login count
                $oUserModel->incrementFailedLogin($oUser->id, $this->aBruteProtection['expire']);

                //  Are we already blocked? Let them know...
                if ($oUser->failed_login_count >= $this->aBruteProtection['limit']) {

                    //  Check if the block has expired
                    if (time() < strtotime($oUser->failed_login_expires)) {
                        $iBlockTime = ceil($this->aBruteProtection['expire'] / 60);
                        $this->setError(lang('auth_login_fail_blocked', $iBlockTime));
                        return false;
                    }

                    //  Block has expired, reset the counter
                    $oUserModel->resetFailedLogin($oUser->id);
                }

                //  Check if the password was changed recently
                if ($oUser->password_changed) {

                    $iChanged = strtotime($oUser->password_changed);
                    $iRecent  = strtotime('-2 WEEKS');

                    if ($iChanged > $iRecent) {
                        $sChangedRecently = niceTime($iChanged);
                    }
                }
            }
        }

        //  Login failed
        if (empty($sChangedRecently)) {
            $this->setError(lang('auth_login_fail_general'));
        } else {
            $this->setError(lang('auth_login_fail_general_recent', $sChangedRecently));
        }

        return false;
    }
460809
public void foundExplanation(ExplanationGenerator<E> explanationGenerator, Explanation<E> explanation, Set<Explanation<E>> allFoundExplanations) {
        notifyLaconicExplanationGeneratorProgressMonitor(explanation);
    }
730889
protected function parseRoutes($uri)
    {
        if (Container::get('config')->get('url_route_annotation')) {
            $finder = new Finder();
            $finder
                ->in(Container::get('config')->get('app_full_path') . '/controllers')
                ->name('*.php');
            $controllerNamespaces = [];
            foreach ($finder as $file) {
                array_push($controllerNamespaces, '\\' . Container::get('config')->get('namespace_prefix') . 'controllers\\' . $file->getBasename('.' . $file->getExtension()));
            }

            foreach ($controllerNamespaces as $namespace) {
                $classReflector = new ReflectionClass($namespace);
                $classAnnotations = new Annotations($classReflector);

                foreach ($classReflector->getMethods() as $methodReflector) {
                    $methodAnnotations = new Annotations($methodReflector);
                    if (!isset($methodAnnotations['route'])) {
                        continue;
                    } else {
                        $routeAnnotations = $methodAnnotations['route'];
                        if (!isset($routeAnnotations['uri'])) {
                            throw new ConfigException('Route annotations error');
                        }

                        $controllerName = $classReflector->getShortName();
                        $actionName = $methodReflector->getName();
                        $route = $controllerName . '/' . $actionName;
                        if (isset($routeAnnotations['params'])) {
                            $route .= '/' . $routeAnnotations['params'];
                        }

                        if (!isset($routeAnnotations['method'])) {
                            $this->routes[$routeAnnotations['uri']] = $route;
                        } else {
                            $this->routes[$routeAnnotations['uri']][$routeAnnotations['method']] = $route;
                        }

                        unset($route);
                    }
                }
            }
        } else {
            $this->routes = Container::get('config')->get('url_route');
        }

        $hostName = Container::get('request')->getHostName();

        if (isset($this->routes[$hostName])) {
            $this->routes = $this->routes[$hostName];
        }

        // Get HTTP verb
        $httpVerb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';

        if (null != $this->routes) {
            foreach ($this->routes as $key => $val) {
                // Check if route format is using HTTP verbs
                if (is_array($val)) {
                    $val = array_change_key_case($val, CASE_LOWER);
                    if (isset($val[$httpVerb])) {
                        $val = $val[$httpVerb];
                    } else {
                        continue;
                    }
                }

                // Does the RegEx match?
                if (preg_match('#^' . $key . '$#', $uri, $matches)) {
                    // Are we using callbacks to process back-references?
                    if (!is_string($val) && is_callable($val)) {
                        // Remove the original string from the matches array.
                        array_shift($matches);

                        // Execute the callback using the values in matches as its parameters.
                        $val = call_user_func_array($val, $matches);
                    } // Are we using the default routing method for back-references?
                    elseif (strpos($val, '$') !== false && strpos($key, '(') !== false) {
                        $val = preg_replace('#^' . $key . '$#', $val, $uri);
                    }

                    return $val;
                }
            }
        }
    }
723524
public function callbackAction($callbackUri) {
		try {
			$this->authenticationManager->authenticate();
		} catch (\TYPO3\Flow\Security\Exception\AuthenticationRequiredException $exception) {
			$authenticationException = $exception;
		}

		if ($this->authenticationManager->isAuthenticated()) {
			$storedRequest = $this->securityContext->getInterceptedRequest();
			if ($storedRequest !== NULL) {
				$this->securityContext->setInterceptedRequest(NULL);
				$this->redirectToRequest($storedRequest);
			} else {
				// TODO Do we have to check the URI?
				$this->redirectToUri($callbackUri);
			}
		} else {
			throw new \Flowpack\SingleSignOn\Client\Exception('Could not authenticate in callbackAction triggered by the SSO server.', 1366613161, (isset($authenticationException) ? $authenticationException : NULL));
		}
	}
926660
public function frontControllerPath($sitePath, $siteName, $uri)
    {
        $_SERVER['PHP_SELF'] = $uri;

        return parent::frontControllerPath($sitePath, $siteName, $uri);
    }
99419
@Override
    public void onProcessUnstructuredSSResponse(ProcessUnstructuredSSResponse procUnstrResInd) {
        if (logger.isDebugEnabled()) {
            logger.debug(String.format("Rx ProcessUnstructuredSSResponseIndication.  USSD String=%s",
                    procUnstrResInd.getUSSDString()));
        }

    }
1213873
public function isSubdomainUriExists( $subdomainId, $uri, $excludeUriId = null )
    {
        return $this->isExists( empty( $excludeUriId ) ? array(
            'subdomainId'   => $subdomainId,
            'uri'           => $uri,
        ) : array(
            'subdomainId'   => $subdomainId,
            'uri'           => $uri,
            new Predicate\Operator(
                'id',
                Predicate\Operator::OP_NE,
                $excludeUriId
            ),
        ) );
    }
1235318
public function render($uri, Request $request, array $options = [])
    {
        if ($uri instanceof ControllerReference) {
            if (null === $this->signer) {
                throw new \LogicException('You must use a proper URI when using the Hinclude rendering strategy or set a URL signer.');
            }

            // we need to sign the absolute URI, but want to return the path only.
            $uri = substr($this->signer->sign($this->generateFragmentUri($uri, $request, true)), \strlen($request->getSchemeAndHttpHost()));
        }

        // We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content.
        $uri = str_replace('&', '&amp;', $uri);

        $template = isset($options['default']) ? $options['default'] : $this->globalDefaultTemplate;
        if (null !== $this->templating && $template && $this->templateExists($template)) {
            $content = $this->templating->render($template);
        } else {
            $content = $template;
        }

        $attributes = isset($options['attributes']) && \is_array($options['attributes']) ? $options['attributes'] : [];
        if (isset($options['id']) && $options['id']) {
            $attributes['id'] = $options['id'];
        }
        $renderedAttributes = '';
        if (\count($attributes) > 0) {
            $flags = ENT_QUOTES | ENT_SUBSTITUTE;
            foreach ($attributes as $attribute => $value) {
                $renderedAttributes .= sprintf(
                    ' %s="%s"',
                    htmlspecialchars($attribute, $flags, $this->charset, false),
                    htmlspecialchars($value, $flags, $this->charset, false)
                );
            }
        }

        return new Response(sprintf('<hx:include src="%s"%s>%s</hx:include>', $uri, $renderedAttributes, $content));
    }