‪TYPO3CMS  9.5
BackendUserGroupIntegrityCheck.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
24 
30 {
38  public function ‪processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, $parentObject)
39  {
40  if ($table !== 'be_groups' || ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['explicitADmode'] !== 'explicitAllow') {
41  return;
42  }
43 
44  $backendUserGroup = ‪BackendUtility::getRecord($table, $id, 'explicit_allowdeny');
45  $explicitAllowDenyFields = GeneralUtility::trimExplode(',', $backendUserGroup['explicit_allowdeny']);
46  foreach ($explicitAllowDenyFields as $value) {
47  if ($value !== '' && strpos($value, 'tt_content:list_type:') === 0) {
48  if (!in_array('tt_content:CType:list:ALLOW', $explicitAllowDenyFields, true)) {
50  $flashMessage = GeneralUtility::makeInstance(
51  FlashMessage::class,
52  $this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:error.backendUserGroupListTypeError.message'),
53  $this->‪getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:error.backendUserGroupListTypeError.header'),
55  true
56  );
58  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
60  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
61  $defaultFlashMessageQueue->enqueue($flashMessage);
62  }
63  return;
64  }
65  }
66  }
67 
71  protected function ‪getLanguageService()
72  {
73  return ‪$GLOBALS['LANG'];
74  }
75 }
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:81
‪TYPO3\CMS\Core\Hooks\BackendUserGroupIntegrityCheck\getLanguageService
‪LanguageService getLanguageService()
Definition: BackendUserGroupIntegrityCheck.php:71
‪TYPO3\CMS\Core\Hooks\BackendUserGroupIntegrityCheck\processDatamap_afterDatabaseOperations
‪processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, $parentObject)
Definition: BackendUserGroupIntegrityCheck.php:38
‪TYPO3\CMS\Core\Messaging\AbstractMessage\WARNING
‪const WARNING
Definition: AbstractMessage.php:28
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:72
‪TYPO3\CMS\Core\Hooks\BackendUserGroupIntegrityCheck
Definition: BackendUserGroupIntegrityCheck.php:30
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecord
‪static array null getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
Definition: BackendUtility.php:130
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:22
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Messaging\FlashMessageQueue
Definition: FlashMessageQueue.php:25
‪TYPO3\CMS\Core\Messaging\FlashMessageService
Definition: FlashMessageService.php:25
‪TYPO3\CMS\Core\Hooks
Definition: BackendUserGroupIntegrityCheck.php:2