2 declare(strict_types = 1);
37 if ($this->data[
'tableName'] !==
'be_users' || $this->data[
'fieldName'] !==
'admin') {
38 throw new \RuntimeException(
39 'The adminIsSystemMaintainer field information can be used for admin field in be_users table only',
45 if ($this->data[
'command'] ===
'new') {
52 $systemMaintainers = array_map(
'intval',
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'systemMaintainers'] ?? []);
53 $isTargetUserInSystemMaintainerList = in_array((
int)$this->data[
'vanillaUid'], $systemMaintainers,
true);
55 if ($isTargetUserInSystemMaintainerList) {
57 $isTargetUserAdmin = (int)$this->data[
'databaseRow'][
'admin'] === 1;
58 if ($isCurrentUserSystemMaintainer) {
59 if ($isTargetUserAdmin) {
61 $fieldInformationText =
'<strong>' . htmlspecialchars($languageService->sL(
62 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:formEngine.beUser.admin.information.userIsSystemMaintainer'
67 $fieldInformationText =
'<strong>' . htmlspecialchars($languageService->sL(
68 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:formEngine.beUser.admin.information.userWillBecomeSystemMaintainer'
73 $fieldInformationText =
'<strong>' . htmlspecialchars($languageService->sL(
74 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:formEngine.beUser.admin.information.userAdminAndPasswordChangeNotAllowed'
77 $resultArray[
'html'] = $fieldInformationText;