LimeSurvey API - Master branch

OptoutController extends LSYii_Controller
in package

optout

Tags
copyright

2011

access

public

Table of Contents

Properties

$defaultAction  : mixed
$layout  : mixed
$navData  : array<string|int, mixed>
This array contains the survey / group / question id used by the menu widget.

Methods

__construct()  : mixed
Basic initialiser to the base controller class
actionparticipants()  : mixed
Display the confirmation page for global opt-out (central participant list).
actionremovetoken()  : mixed
Secure opt-out endpoint (POST-only). Prevents email security scanners (Microsoft Defender Safe Links, Proofpoint, etc.) from automatically triggering opt-out by following GET links.
actionremovetokens()  : mixed
Legacy opt-out endpoint (GET-based). Kept for backward compatibility with already-sent emails and custom themes that still use <a href> links.
actiontokens()  : mixed
Display the confirmation page for individual survey opt-out.
createAbsoluteUrl()  : string
Returns an absolute URL based on the given controller and action information.
loadHelper()  : void
Loads a helper
loadLibrary()  : void
Loads a library
_checkInstallation()  : void
Check that installation was already done by looking for config.php Will redirect to the installer script if not exists.
customInit()  : mixed
loadPageStates()  : array<string|int, mixed>
Loads page states from a hidden input.
handleOptout()  : Survey, tokenAttributes: array, participantAttributes: array}
Common opt-out logic shared by actionremovetokens() and actionremovetoken().
renderHtml()  : void
Render the opt-out/opt-in themed page via Twig.

Properties

$navData

This array contains the survey / group / question id used by the menu widget.

public array<string|int, mixed> $navData = array()

Methods

__construct()

Basic initialiser to the base controller class

public __construct(string $id[, CWebModule $module = null ]) : mixed
Parameters
$id : string
$module : CWebModule = null
Tags
access

public

actionparticipants()

Display the confirmation page for global opt-out (central participant list).

public actionparticipants() : mixed

Provides both a legacy GET link (optin_link) for old themes and a secure POST link (optin_post_link) for updated themes.

Tags
throws
CHttpException

actionremovetoken()

Secure opt-out endpoint (POST-only). Prevents email security scanners (Microsoft Defender Safe Links, Proofpoint, etc.) from automatically triggering opt-out by following GET links.

public actionremovetoken() : mixed

actionremovetokens()

Legacy opt-out endpoint (GET-based). Kept for backward compatibility with already-sent emails and custom themes that still use <a href> links.

public actionremovetokens() : mixed

New templates should use actionremovetoken() via POST instead.

actiontokens()

Display the confirmation page for individual survey opt-out.

public actiontokens() : mixed

Provides both a legacy GET link (optin_link) for old themes and a secure POST link (optin_post_link) for updated themes.

Tags
throws
CHttpException

createAbsoluteUrl()

Returns an absolute URL based on the given controller and action information.

public createAbsoluteUrl(string $route[, array<string|int, mixed> $params = array() ][, string $schema = '' ][, string $ampersand = '&' ]) : string

The functionality was moved to \LSYii_Application::createPublicUrl, to be safe the function remains here.

Parameters
$route : string

the URL route. This should be in the format of 'ControllerID/ActionID'.

$params : array<string|int, mixed> = array()

additional GET parameters (name=>value). Both the name and value will be URL-encoded.

$schema : string = ''

schema to use (e.g. http, https). If empty, the schema used for the current request will be used.

$ampersand : string = '&'

the token separating name-value pairs in the URL.

Return values
string

the constructed URL

loadHelper()

Loads a helper

public loadHelper(string $helper) : void
Parameters
$helper : string
Tags
access

public

loadLibrary()

Loads a library

public loadLibrary(string $library) : void
Parameters
$library : string
Tags
access

public

_checkInstallation()

Check that installation was already done by looking for config.php Will redirect to the installer script if not exists.

protected _checkInstallation() : void
Tags
access

protected

loadPageStates()

Loads page states from a hidden input.

protected loadPageStates() : array<string|int, mixed>
Return values
array<string|int, mixed>

the loaded page states

handleOptout()

Common opt-out logic shared by actionremovetokens() and actionremovetoken().

private handleOptout() : Survey, tokenAttributes: array, participantAttributes: array}

Validates the survey, resolves the language, loads the token, sets emailstatus to 'OptOut', and optionally blacklists the participant globally.

Tags
throws
CHttpException
Return values
Survey, tokenAttributes: array, participantAttributes: array}

renderHtml()

Render the opt-out/opt-in themed page via Twig.

private renderHtml(string $message, Survey $survey[, string $link = '' ][, array<string, mixed> $token = [] ][, array<string, mixed> $participant = [] ][, string $postLink = '' ]) : void
Parameters
$message : string
$survey : Survey
$link : string = ''

Legacy GET URL for the opt-out action (used by old themes via optin_link)

$token : array<string, mixed> = []
$participant : array<string, mixed> = []
$postLink : string = ''

Secure POST-only URL for the opt-out action (used by updated themes via optin_post_link)


        
On this page

Search results