![]() |
TYPO3
7.6
|
Static Public Member Functions | |
static | get ($className= 'default') |
static | set ($className, AbstractFormProtection $instance) |
static | purgeInstances () |
Static Protected Member Functions | |
static | getClassNameAndConstructorArgumentsByState () |
static | isInstallToolSession () |
static | isBackendSession () |
static | isFrontendSession () |
static | createInstance (array $classNameAndConstructorArguments) |
Static Protected Attributes | |
static | $instances = array() |
Private Member Functions | |
__construct () | |
This class creates and manages instances of the various form protection classes.
This class provides only static methods. It can not be instantiated.
Usage for the back-end form protection:
$formProtection = ::get();
Usage for the install tool form protection:
$formProtection = ::get();
Definition at line 41 of file FormProtectionFactory.php.
|
private |
Private constructor to prevent instantiation.
Definition at line 53 of file FormProtectionFactory.php.
|
staticprotected |
Creates an instance for the requested class $className and stores it internally.
array | $classNameAndConstructorArguments |
\InvalidArgumentException |
Definition at line 181 of file FormProtectionFactory.php.
|
static |
Gets a form protection instance for the requested class $className.
If there already is an existing instance of the requested $className, the existing instance will be returned. If no $className is provided, the factory detects the scope and returns the appropriate form protection object.
string | $className |
Definition at line 67 of file FormProtectionFactory.php.
Referenced by SetupModuleController\__construct(), UriBuilder\buildUriFromAjaxId(), UriBuilder\buildUriFromModule(), UriBuilder\buildUriFromRoute(), LoginController\checkRedirect(), RouteDispatcher\getFormProtection(), AjaxRequestHandler\getFormProtection(), and BackendModuleRequestHandler\getFormProtection().
|
staticprotected |
Returns the class name depending on TYPO3_MODE and active backend session.
Definition at line 87 of file FormProtectionFactory.php.
References $GLOBALS, and GeneralUtility\makeInstance().
|
staticprotected |
Checks if a user is logged in and the session is active.
Definition at line 136 of file FormProtectionFactory.php.
References $GLOBALS.
|
staticprotected |
Checks if a frontend user is logged in and the session is active.
Definition at line 146 of file FormProtectionFactory.php.
References $GLOBALS.
|
staticprotected |
Check if we are in the install tool
Definition at line 126 of file FormProtectionFactory.php.
|
static |
Purges all existing instances.
This function is particularly useful when cleaning up in unit testing.
Definition at line 217 of file FormProtectionFactory.php.
|
static |
Sets the instance that will be returned by get() for a specific class name.
Note: This function is intended for testing purposes only.
private
string | $className | |
AbstractFormProtection | $instance |
Definition at line 205 of file FormProtectionFactory.php.
|
staticprotected |
Definition at line 48 of file FormProtectionFactory.php.