‪TYPO3CMS  10.4
TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService Class Reference
Inheritance diagram for TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 validateFormDefinitionProperties (array $currentFormElement, string $prototypeName, string $sessionToken)
 
bool isPropertyValueEqualToHistoricalValue (array $hmacContent, $propertyValue, array $hmacData, string $sessionToken)
 

Protected Member Functions

 checkHmacDataIntegrity (array $hmacData, array $hmacContent, string $sessionToken)
 
 validateAllFormElementPropertyValuesByHmac (array $currentElement, $sessionToken, ValidationDto $validationDto)
 
 validateAllPropertyCollectionElementValuesByHmac (array $currentElement, $sessionToken, ValidationDto $validationDto)
 
 validateAllPropertyValuesFromCreatableFormElement (array $currentElement, $sessionToken, ValidationDto $validationDto)
 
 validateAllPropertyValuesFromCreatablePropertyCollectionElement (array $currentElement, $sessionToken, ValidationDto $validationDto)
 
ConfigurationService getConfigurationService ()
 
ObjectManager getObjectManager ()
 

Protected Attributes

ConfigurationService $configurationService
 

Detailed Description

Definition at line 35 of file FormDefinitionValidationService.php.

Member Function Documentation

◆ checkHmacDataIntegrity()

TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::checkHmacDataIntegrity ( array  $hmacData,
array  $hmacContent,
string  $sessionToken 
)
protected

Compares the historical value and the hmac hash to ensure the integrity of the data. An exception will be thrown if the value is modified.

Parameters
array$hmacData
array$hmacContent
string$sessionToken
Exceptions
PropertyException

Definition at line 252 of file FormDefinitionValidationService.php.

Referenced by TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\isPropertyValueEqualToHistoricalValue().

◆ getConfigurationService()

◆ getObjectManager()

ObjectManager TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::getObjectManager ( )
protected

◆ isPropertyValueEqualToHistoricalValue()

bool TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::isPropertyValueEqualToHistoricalValue ( array  $hmacContent,
  $propertyValue,
array  $hmacData,
string  $sessionToken 
)

Returns TRUE if a property value is equals to the historical value and FALSE if not. "Historical values" means values which are available within the form definition while the form editor is loaded and the values which are available after a successful validation of the form definition on a save operation. The value must be equal to the historical value if the property key for the value is not defined within the form setup. This means that the property can not be changed by the form editor but we want to keep the value in its original state. If this is not the case (return value is FALSE), an exception must be thrown.

Parameters
array$hmacContent
mixed$propertyValue
array$hmacData
string$sessionToken
Returns
‪bool
Exceptions
PropertyException

Definition at line 229 of file FormDefinitionValidationService.php.

References TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\checkHmacDataIntegrity().

◆ validateAllFormElementPropertyValuesByHmac()

TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::validateAllFormElementPropertyValuesByHmac ( array  $currentElement,
  $sessionToken,
ValidationDto  $validationDto 
)
protected

Walk through all form element properties and checks if the values matches to their hmac hashes.

Parameters
array$currentElement
string$sessionToken
ValidationDto$validationDto

Definition at line 275 of file FormDefinitionValidationService.php.

Referenced by TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\validateFormDefinitionProperties().

◆ validateAllPropertyCollectionElementValuesByHmac()

TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::validateAllPropertyCollectionElementValuesByHmac ( array  $currentElement,
  $sessionToken,
ValidationDto  $validationDto 
)
protected

Walk through all property collection properties and checks if the values matches to their hmac hashes.

Parameters
array$currentElement
string$sessionToken
ValidationDto$validationDto

Definition at line 303 of file FormDefinitionValidationService.php.

Referenced by TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\validateFormDefinitionProperties().

◆ validateAllPropertyValuesFromCreatableFormElement()

TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::validateAllPropertyValuesFromCreatableFormElement ( array  $currentElement,
  $sessionToken,
ValidationDto  $validationDto 
)
protected

Walk through all form element properties and checks if the property is defined within the form editor setup or if the property is defined within the "predefinedDefaults" in the form editor setup and the property value matches the predefined value or if there is a valid hmac hash for the value.

Parameters
array$currentElement
string$sessionToken
ValidationDto$validationDto

Definition at line 334 of file FormDefinitionValidationService.php.

Referenced by TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\validateFormDefinitionProperties().

◆ validateAllPropertyValuesFromCreatablePropertyCollectionElement()

TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::validateAllPropertyValuesFromCreatablePropertyCollectionElement ( array  $currentElement,
  $sessionToken,
ValidationDto  $validationDto 
)
protected

Walk through all property collection properties and checks if the property is defined within the form editor setup or if the property is defined within the "predefinedDefaults" in the form editor setup and the property value matches the predefined value or if there is a valid hmac hash for the value.

Parameters
array$currentElement
string$sessionToken
ValidationDto$validationDto

Definition at line 365 of file FormDefinitionValidationService.php.

Referenced by TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\validateFormDefinitionProperties().

◆ validateFormDefinitionProperties()

TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::validateFormDefinitionProperties ( array  $currentFormElement,
string  $prototypeName,
string  $sessionToken 
)

Validate the form definition properties using the form setup. Pseudo workflow: Is the form element type creatable by the form editor? YES foreach(form element properties) (without finishers|validators) is the form element property defined in the form setup (can be manipulated)? YES is the form element property configured to only allow a limited set of values (e.g. Inspector-MultiSelectEditor, Inspector-SingleSelectEditor ...) YES is the form element property value within the set of allowed values? YES valid! NO invalid! throw exception NO valid! NO is the form element property defined in "predefinedDefaults" in the form setup (cannot be manipulated but should be written)? YES is the form element property value equals to the value defined in "predefinedDefaults" in the form setup? YES valid! NO invalid! throw exception NO is there a hmac hash available for the form element property value (cannot be manipulated but should be written)? YES is the form element property value equals the historical value (and is the historical value valid)? YES valid! NO invalid! throw exception NO invalid! throw exception foreach(form elements finishers|validators) is the form elements finisher|validator creatable by the form editor? YES foreach(form elements finisher|validator properties) is the form elements finisher|validator property defined in the form setup (can be manipulated)? YES is the form elements finisher|validator property configured to only allow a limited set of values (e.g. Inspector-MultiSelectEditor, Inspector-SingleSelectEditor ...) YES is the form elements finisher|validator property value within the set of allowed values? YES valid! NO invalid! throw exception NO valid! NO is the form elements finisher|validator property defined in "predefinedDefaults" in the form setup (cannot be manipulated but should be written)? YES is the form elements finisher|validator property value equals to the value defined in "predefinedDefaults" in the form setup? YES valid! NO invalid! throw exception NO is there a hmac hash available for the form elements finisher|validator property value (can not be manipulated but should be written)? YES is the form elements finisher|validator property value equals the historical value (and is the historical value valid)? YES valid! NO invalid! throw exception NO invalid! throw exception NO foreach(form elements finisher|validator properties) is there a hmac hash available for the form elements finisher|validator property value (can not be manipulated but should be written)? YES is the form elements finisher|validator property value equals the historical value (and is the historical value valid)? YES valid! NO invalid! throw exception NO invalid! throw exception NO foreach(form element properties) (without finishers|validators) is there a hmac hash available for the form element property value (cannot be manipulated but should be written)? YES is the form element property value equals the historical value (and is the historical value valid)? YES valid! NO invalid! throw exception NO invalid! throw exception foreach(form elements finisher|validator properties) is there a hmac hash available for the form elements finisher|validator property value (can not be manipulated but should be written)? YES is the form elements finisher|validator property value equals the historical value (and is the historical value valid)? YES valid! NO invalid! throw exception NO invalid! throw exception

Parameters
array$currentFormElement
string$prototypeName
string$sessionToken
Exceptions
PropertyException

Definition at line 148 of file FormDefinitionValidationService.php.

References TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\getConfigurationService(), TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\validateAllFormElementPropertyValuesByHmac(), TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\validateAllPropertyCollectionElementValuesByHmac(), TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\validateAllPropertyValuesFromCreatableFormElement(), and TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\validateAllPropertyValuesFromCreatablePropertyCollectionElement().

Member Data Documentation

◆ $configurationService

ConfigurationService TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService::$configurationService
protected