Commit 0a1053d2 authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Benni Mack
Browse files

[BUGFIX] Fix PHP 8 related issues in BackendUserAuthentication

Resolves: #94416
Releases: master
Change-Id: Id11afdd6d7ba00cd9ed1712aa43543dfc85d7725
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69574


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 9690e129
......@@ -779,7 +779,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
if ($table === 'pages' && $checkFullLanguageAccess && !$this->checkFullLanguagesAccess($table, $idOrRow)) {
return false;
}
if ($GLOBALS['TCA'][$table]['ctrl']['languageField']) {
if ($GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? false) {
// Language field must be found in input row - otherwise it does not make sense.
if (isset($idOrRow[$GLOBALS['TCA'][$table]['ctrl']['languageField']])) {
if (!$this->checkLanguageAccess($idOrRow[$GLOBALS['TCA'][$table]['ctrl']['languageField']])) {
......@@ -802,23 +802,20 @@ class BackendUserAuthentication extends AbstractUserAuthentication
// Checking authMode fields:
if (is_array($GLOBALS['TCA'][$table]['columns'])) {
foreach ($GLOBALS['TCA'][$table]['columns'] as $fieldName => $fieldValue) {
if (isset($idOrRow[$fieldName])) {
if (
$fieldValue['config']['type'] === 'select' && $fieldValue['config']['authMode']
&& $fieldValue['config']['authMode_enforce'] === 'strict'
) {
if (!$this->checkAuthMode($table, $fieldName, $idOrRow[$fieldName], $fieldValue['config']['authMode'])) {
$this->errorMsg = 'ERROR: authMode "' . $fieldValue['config']['authMode']
. '" failed for field "' . $fieldName . '" with value "'
. $idOrRow[$fieldName] . '" evaluated';
return false;
}
}
if (isset($idOrRow[$fieldName])
&& ($fieldValue['config']['type'] ?? '') === 'select'
&& ($fieldValue['config']['authMode'] ?? false)
&& ($fieldValue['config']['authMode_enforce'] ?? '') === 'strict'
&& !$this->checkAuthMode($table, $fieldName, $idOrRow[$fieldName], $fieldValue['config']['authMode'])) {
$this->errorMsg = 'ERROR: authMode "' . $fieldValue['config']['authMode']
. '" failed for field "' . $fieldName . '" with value "'
. $idOrRow[$fieldName] . '" evaluated';
return false;
}
}
}
// Checking "editlock" feature (doesn't apply to new records)
if (!$newRecord && $GLOBALS['TCA'][$table]['ctrl']['editlock']) {
if (!$newRecord && ($GLOBALS['TCA'][$table]['ctrl']['editlock'] ?? false)) {
if (isset($idOrRow[$GLOBALS['TCA'][$table]['ctrl']['editlock']])) {
if ($idOrRow[$GLOBALS['TCA'][$table]['ctrl']['editlock']]) {
$this->errorMsg = 'ERROR: Record was locked for editing. Only admin users can change this state.';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment