CoolCMS API

AdvertAuthorizationFormTrait

Lets a guest authorize to edit a company profile with a password.

Shown through setView('authorizationForm') directly in the edit action, so the URL stays and no new route is needed. After a correct password the session stores the token [id, hash, expiration], 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
Refreshes the session token after an edit: rewrites the hash and extends the expiration.
renderAuthorizationForm()  : void

Constants

Properties

Methods

refreshAdvertSession()

Refreshes the session token after an edit: 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