CoolCMS API

MessageConfirmationManager
in package
uses ConfirmByKeyTrait

FinalYes

Confirms a discussion post by the key from the `DS_MESSAGE_ACTIVATION_REQUEST` e-mail.

Shares its logic with adverts via ConfirmByKeyTrait. Column writes go through MessageManager so the cache is bumped. Called from :Api:Discussion:Message:confirmByKey (internal bridge only, grant guest).

Table of Contents

Constants

CONFIRM_KEY_MAX_LENGTH  : int = 128
Input longer than any issued key is not even looked up (64 hex characters).

Properties

$messageManager  : MessageManager
$messageService  : MessageService
$rateLimit  : RateLimit
$rateLimitConfig  : RateLimitConfig

Methods

__construct()  : mixed
confirmByKey()  : Result
afterRecordConfirmed()  : void
Intentionally empty: the ES document does not carry confirmation (the DB phase of the listing filters it) and discussion keeps no per-category post counts. `updateColumns()` bumps the entity cache itself.
confirmationKeyInvalidCode()  : ResultCode
confirmIpLimitKey()  : string
confirmRecordLimitKey()  : string
The limit keys keep the format from when the trait knew only adverts (`advert-confirm:<module>:advert:<id>`).
findRecordForConfirmation()  : Message|null
Loads fresh from the DB (`useCache = false`); a cached record would let a consumed key be used again.
getConfirmModule()  : string
passesConfirmLimit()  : bool
Peeks without incrementing: only failed attempts spend the quota ({@see self::rejectConfirmation()}).
rejectConfirmation()  : Result
updateConfirmationColumns()  : Result

Constants

CONFIRM_KEY_MAX_LENGTH

Input longer than any issued key is not even looked up (64 hex characters).

private int CONFIRM_KEY_MAX_LENGTH = 128

Properties

Methods

confirmByKey()

public confirmByKey(int $id, string $key, string|null $ip) : Result
Parameters
$id : int
$key : string
$ip : string|null
Return values
Result

afterRecordConfirmed()

Intentionally empty: the ES document does not carry confirmation (the DB phase of the listing filters it) and discussion keeps no per-category post counts. `updateColumns()` bumps the entity cache itself.

private afterRecordConfirmed(int $id) : void
Parameters
$id : int

confirmIpLimitKey()

private confirmIpLimitKey(string|null $ip) : string
Parameters
$ip : string|null
Return values
string

confirmRecordLimitKey()

The limit keys keep the format from when the trait knew only adverts (`advert-confirm:<module>:advert:<id>`).

private confirmRecordLimitKey(int $id) : string
Parameters
$id : int
Return values
string

findRecordForConfirmation()

Loads fresh from the DB (`useCache = false`); a cached record would let a consumed key be used again.

private findRecordForConfirmation(int $id) : Message|null
Parameters
$id : int
Return values
Message|null

passesConfirmLimit()

Peeks without incrementing: only failed attempts spend the quota ({@see self::rejectConfirmation()}).

private passesConfirmLimit(int $id, string|null $ip) : bool
Parameters
$id : int
$ip : string|null
Return values
bool

rejectConfirmation()

private rejectConfirmation(int $id, string|null $ip) : Result
Parameters
$id : int
$ip : string|null
Return values
Result

updateConfirmationColumns()

private updateConfirmationColumns(int $id, array<string, mixed> $values) : Result
Parameters
$id : int
$values : array<string, mixed>
Return values
Result
On this page

Search results