FluidTYPO3\Vhs\ViewHelpers\Security\AbstractSecurityViewHelper::assertFrontendUserLoggedIn PHP Method

assertFrontendUserLoggedIn() public method

Returns TRUE only if a FrontendUser is currently logged in. Use argument to return TRUE only if the FrontendUser logged in must be that specific user.
public assertFrontendUserLoggedIn ( TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser = null ) : boolean
$frontendUser TYPO3\CMS\Extbase\Domain\Model\FrontendUser
return boolean
    public function assertFrontendUserLoggedIn(FrontendUser $frontendUser = null)
    {
        $currentFrontendUser = $this->getCurrentFrontendUser();
        if (false === $currentFrontendUser instanceof FrontendUser) {
            return false;
        }
        if (true === $frontendUser instanceof FrontendUser && true === $currentFrontendUser instanceof FrontendUser) {
            if ($currentFrontendUser->getUid() === $frontendUser->getUid()) {
                return true;
            } else {
                return false;
            }
        }
        return (bool) (true === is_object($currentFrontendUser));
    }