main/core/Listener/AuthenticationSuccessListener.php
private function getUser(Request $request)
    {
        if ($this->configurationHandler->getParameter('terms_of_service')
            && 'claroline_locale_change' !== $request->get('_route')
            && 'claroline_locale_select' !== $request->get('_route')
            && 'bazinga_exposetranslation_js' !== $request->get('_route')
            && ($token = $this->tokenStorage->getToken())
            && ($user = $token->getUser())
            && $user instanceof User
        ) {
            return $user;
        }

        return null;
    }
private function getUser(Request $request)
    {
        if ($this->configurationHandler->getParameter('terms_of_service')
            && 'claroline_locale_change' !== $request->get('_route')
            && 'claroline_locale_select' !== $request->get('_route')
            && 'bazinga_exposetranslation_js' !== $request->get('_route')
            && ($token = $this->tokenStorage->getToken())
            && ($user = $token->getUser())
            && $user instanceof User
        ) {
            return $user;
        }

        return null;
    }
private function getUser ( Request $ request ) { if ( $ this -> configurationHandler -> getParameter ( 'terms_of_service' ) && 'claroline_locale_change' !== $ request -> get ( '_route' ) && 'claroline_locale_select' !== $ request -> get ( '_route' ) && 'bazinga_exposetranslation_js' !== $ request -> get ( '_route' ) && ( $ token = $ this -> tokenStorage -> getToken ( ) ) && ( $ user = $ token -> getUser ( ) ) && $ user instanceof User ) { return $ user ; } return null ; }
Return a user if need to accept the terms of service.

@param \Symfony\Component\HttpFoundation\Request $request

@return User
Return a user if need to accept the terms of service .