PHP Class Sulu\Bundle\SecurityBundle\Controller\ResettingController

Inheritance: extends Symfony\Bundle\FrameworkBundle\Controller\Controller
Mostrar archivo Open project: sulu/sulu

Protected Properties

Property Type Description
$emailMessageKey
$emailSubjectKey
$resetRouteId
$translationDomain

Public Methods

Method Description
resetAction ( Request $request ) : Symfony\Component\HttpFoundation\JsonResponse Resets a users password.
sendEmailAction ( Request $request, boolean $generateNewKey = true ) : Symfony\Component\HttpFoundation\JsonResponse Generates a token for a user and sends an email with a link to the resetting route.

Protected Methods

Method Description
getMessage ( Symfony\Component\Security\Core\User\UserInterface $user ) : string
getSenderAddress ( Request $request ) : string Returns the sender's email address.
getSubject ( ) : string
getTranslator ( ) : Translator

Private Methods

Method Description
changePassword ( Symfony\Component\Security\Core\User\UserInterface $user, string $password ) Changes the password of a user.
dateIsInRequestFrame ( DateTime $date ) : boolean Takes a date-time of a reset-token and returns true iff the token associated with the date-time was requested less then the request-interval before. (So there is not really a need to generate a new token).
deleteToken ( Symfony\Component\Security\Core\User\UserInterface $user ) Deletes the user's reset-password-token.
encodePassword ( Symfony\Component\Security\Core\User\UserInterface $user, string $password, string $salt ) : mixed Returns an encoded password gor a given one.
findUser ( string $identifier ) : Symfony\Component\Security\Core\User\UserInterface Finds a user with an identifier (username or email).
findUserByValidToken ( string $token ) : Symfony\Component\Security\Core\User\UserInterface Returns a user for a given token and checks if the token is still valid.
generateTokenForUser ( Symfony\Component\Security\Core\User\UserInterface $user ) Generates a new token for a new user.
getEmail ( Symfony\Component\Security\Core\User\UserInterface $user ) : string Returns the users email or as a fallback the installation-email-adress.
getRequestInterval ( ) : DateInterval The interval in which only one token can be generated.
getResetInterval ( ) : DateInterval The interval in which the token is valid.
getToken ( ) : string Returns a unique token.
getTokenGenerator ( ) : Sulu\Bundle\SecurityBundle\Util\TokenGeneratorInterface
getUniqueToken ( string $startToken ) : string If the passed token is unique returns it back otherwise returns a unique token.
getUserRepository ( ) : Sulu\Component\Security\Authentication\UserRepositoryInterface
loginUser ( Symfony\Component\Security\Core\User\UserInterface $user, $request ) Gives a user a token, so she's logged in.
sendTokenEmail ( Symfony\Component\Security\Core\User\UserInterface $user, string $from, string $to ) Sends the password-reset-token of a user to an email-adress.

Method Details

getMessage() protected method

protected getMessage ( Symfony\Component\Security\Core\User\UserInterface $user ) : string
$user Symfony\Component\Security\Core\User\UserInterface
return string

getSenderAddress() protected method

Returns the sender's email address.
protected getSenderAddress ( Request $request ) : string
$request Symfony\Component\HttpFoundation\Request
return string

getSubject() protected method

protected getSubject ( ) : string
return string

getTranslator() protected method

protected getTranslator ( ) : Translator
return Symfony\Component\Translation\Translator

resetAction() public method

Resets a users password.
public resetAction ( Request $request ) : Symfony\Component\HttpFoundation\JsonResponse
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\JsonResponse

sendEmailAction() public method

Generates a token for a user and sends an email with a link to the resetting route.
public sendEmailAction ( Request $request, boolean $generateNewKey = true ) : Symfony\Component\HttpFoundation\JsonResponse
$request Symfony\Component\HttpFoundation\Request
$generateNewKey boolean If true a new token will be generated before sending the mail
return Symfony\Component\HttpFoundation\JsonResponse

Property Details

$emailMessageKey protected_oe static_oe property

protected static $emailMessageKey

$emailSubjectKey protected_oe static_oe property

protected static $emailSubjectKey

$resetRouteId protected_oe static_oe property

protected static $resetRouteId

$translationDomain protected_oe static_oe property

protected static $translationDomain