‪TYPO3CMS  ‪main
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)
 
 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)
 

Detailed Description

Definition at line 34 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.

Exceptions
PropertyException

Definition at line 237 of file FormDefinitionValidationService.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\hmac().

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

◆ isPropertyValueEqualToHistoricalValue()

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
mixed$propertyValue
Exceptions
PropertyException

Definition at line 217 of file FormDefinitionValidationService.php.

References TYPO3\CMS\Form\Domain\Configuration\FormDefinitionValidationService\checkHmacDataIntegrity(), and TYPO3\CMS\Core\Utility\GeneralUtility\hmac().

◆ 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
string$sessionToken

Definition at line 258 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
string$sessionToken

Definition at line 284 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
string$sessionToken

Definition at line 313 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
string$sessionToken

Definition at line 342 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

Exceptions
PropertyException

Definition at line 139 of file FormDefinitionValidationService.php.

References 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().