PHP Class Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedCookieManager

Show file Open project: scheb/two-factor-bundle Class Usage Examples

Public Methods

Method Description
__construct ( Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedTokenGenerator $tokenGenerator, Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedComputerManagerInterface $trustedComputerManager, string $cookieName, integer $cookieLifetime, boolean $cookieSecure ) Construct a manager for the trusted cookie.
createTrustedCookie ( Request $request, mixed $user ) : Cookie Create a cookie for trusted computer.
isTrustedComputer ( Request $request, mixed $user ) : boolean Check if request has trusted cookie and if it's valid.

Protected Methods

Method Description
getDateTimeNow ( ) : DateTime Return current DateTime object.

Method Details

__construct() public method

Construct a manager for the trusted cookie.
public __construct ( Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedTokenGenerator $tokenGenerator, Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedComputerManagerInterface $trustedComputerManager, string $cookieName, integer $cookieLifetime, boolean $cookieSecure )
$tokenGenerator Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedTokenGenerator
$trustedComputerManager Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedComputerManagerInterface
$cookieName string
$cookieLifetime integer
$cookieSecure boolean

createTrustedCookie() public method

Create a cookie for trusted computer.
public createTrustedCookie ( Request $request, mixed $user ) : Cookie
$request Symfony\Component\HttpFoundation\Request
$user mixed
return Symfony\Component\HttpFoundation\Cookie

getDateTimeNow() protected method

Return current DateTime object.
protected getDateTimeNow ( ) : DateTime
return DateTime

isTrustedComputer() public method

Check if request has trusted cookie and if it's valid.
public isTrustedComputer ( Request $request, mixed $user ) : boolean
$request Symfony\Component\HttpFoundation\Request
$user mixed
return boolean