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