CoolCMS API

AdvertAuthorizationFormTrait

Lets a guest log in to edit an advert with the advert password.

Shown through setView('authorizationForm') directly in the edit action: the URL does not change and no new route is needed. After a correct password a token [id, hash, expiration] is stored in the session, which checkAutorization() in EditAdvertFormTrait verifies on every access.

Tags
requires

EditAdvertFormTrait: shares $advert, checkAutorization() and sessionSection

Table of Contents

Constants

advertSessionExpiration  : mixed = 7200

Properties

$forgotPasswordFormFactory  : ForgotPasswordFormFactory
$frontFormLimiter  : FrontFormLimiter

Methods

authFormSucceeded()  : void
createComponentAuthForm()  : Form
createComponentForgotPasswordForm()  : ForgotPasswordForm
refreshAdvertSession()  : void
Updates the session token after editing: rewrites the hash and extends the expiration.
renderAuthorizationForm()  : void

Constants

Properties

Methods

refreshAdvertSession()

Updates the session token after editing: rewrites the hash and extends the expiration.

public refreshAdvertSession(Advert $advert) : void

Call it after a successful save, when $advert->getPassword() holds the new hash.

Parameters
$advert : Advert
On this page

Search results