‪TYPO3CMS  10.4
TYPO3\CMS\Core\FormProtection\AbstractFormProtection Class Reference
Inheritance diagram for TYPO3\CMS\Core\FormProtection\AbstractFormProtection:
TYPO3\CMS\Core\Security\BlockSerializationTrait TYPO3\CMS\Core\FormProtection\BackendFormProtection TYPO3\CMS\Core\FormProtection\DisabledFormProtection TYPO3\CMS\Core\FormProtection\FrontendFormProtection TYPO3\CMS\Core\FormProtection\InstallToolFormProtection TYPO3\CMS\Core\Tests\Unit\FormProtection\Fixtures\FormProtectionTesting

Public Member Functions

 __destruct ()
 
 clean ()
 
string generateToken ($formName, $action='', $formInstanceName='')
 
bool validateToken ($tokenId, $formName, $action='', $formInstanceName='')
 
 persistSessionToken ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Security\BlockSerializationTrait
 __wakeup ()
 

Protected Member Functions

string getSessionToken ()
 
string generateSessionToken ()
 
 createValidationErrorMessage ()
 
string retrieveSessionToken ()
 

Protected Attributes

Closure $validationFailedCallback
 
string $sessionToken
 

Detailed Description

This class provides protection against cross-site request forgery (XSRF/CSRF) for forms.

For documentation on how to use this class, please see the documentation of the corresponding subclasses

Definition at line 29 of file AbstractFormProtection.php.

Constructor & Destructor Documentation

◆ __destruct()

Member Function Documentation

◆ clean()

TYPO3\CMS\Core\FormProtection\AbstractFormProtection::clean ( )

Deletes the session token and persists the (empty) token.

This function is intended to be called when a user logs on or off.

Definition at line 64 of file AbstractFormProtection.php.

References TYPO3\CMS\Core\FormProtection\AbstractFormProtection\persistSessionToken().

Referenced by TYPO3\CMS\Core\Tests\Unit\FormProtection\AbstractFormProtectionTest\cleanPersistsToken(), and TYPO3\CMS\Core\Authentication\BackendUserAuthentication\logoff().

◆ createValidationErrorMessage()

TYPO3\CMS\Core\FormProtection\AbstractFormProtection::createValidationErrorMessage ( )
protected

Creates or displays an error message telling the user that the submitted form token is invalid.

Definition at line 130 of file AbstractFormProtection.php.

Referenced by TYPO3\CMS\Core\FormProtection\AbstractFormProtection\validateToken().

◆ generateSessionToken()

string TYPO3\CMS\Core\FormProtection\AbstractFormProtection::generateSessionToken ( )
protected

◆ generateToken()

string TYPO3\CMS\Core\FormProtection\AbstractFormProtection::generateToken (   $formName,
  $action = '',
  $formInstanceName = '' 
)

◆ getSessionToken()

◆ persistSessionToken()

◆ retrieveSessionToken()

◆ validateToken()

Member Data Documentation

◆ $sessionToken

◆ $validationFailedCallback

Closure TYPO3\CMS\Core\FormProtection\AbstractFormProtection::$validationFailedCallback
protected