TYPO3 CMS  TYPO3_8-7
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 
29 {
37  public function processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, $parentObject)
38  {
39  if ($table !== 'be_groups' || $GLOBALS['TYPO3_CONF_VARS']['BE']['explicitADmode'] !== 'explicitAllow') {
40  return;
41  }
42 
43  $backendUserGroup = BackendUtility::getRecord($table, $id, 'explicit_allowdeny');
44  $explicitAllowDenyFields = GeneralUtility::trimExplode(',', $backendUserGroup['explicit_allowdeny']);
45  foreach ($explicitAllowDenyFields as $value) {
46  if ($value !== '' && strpos($value, 'tt_content:list_type:') === 0) {
47  if (!in_array('tt_content:CType:list:ALLOW', $explicitAllowDenyFields, true)) {
49  $flashMessage = GeneralUtility::makeInstance(
50  FlashMessage::class,
51  $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:error.backendUserGroupListTypeError.message'),
52  $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:error.backendUserGroupListTypeError.header'),
54  true
55  );
57  $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
59  $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
60  $defaultFlashMessageQueue->enqueue($flashMessage);
61  }
62  return;
63  }
64  }
65  }
66 
70  protected function getLanguageService()
71  {
72  return $GLOBALS['LANG'];
73  }
74 }
static trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
static makeInstance($className,... $constructorArguments)
static getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']