[BUGFIX] Excludefieds must exclude admin only tables 53/12853/2
authorGeorg Ringer <mail@ringerge.org>
Sat, 3 Mar 2012 13:21:32 +0000 (14:21 +0100)
committerBenjamin Mack <benni@typo3.org>
Sat, 9 Feb 2013 05:16:28 +0000 (06:16 +0100)
The field "allowed excludefields" should not show
fields of tables which are restricted to admins,
either because of the flag adminOnly =1 or
rootLevel = 1

Change-Id: Ie5a9c445275077984400017adc84dc0557d9c639
Resolves: #34460
Releases: 4.8,4.7,4.6,4.5
Reviewed-on: https://review.typo3.org/12853
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
t3lib/class.t3lib_befunc.php

index e5ad43d..033c73d 100644 (file)
@@ -755,8 +755,11 @@ final class t3lib_BEfunc {
                foreach ($tc_keys as $table) {
                                // Load table
                        t3lib_div::loadTCA($table);
-                               // All field names configured
-                       if (is_array($GLOBALS['TCA'][$table]['columns'])) {
+                               // All field names configured and not restricted to admins
+                       if (is_array($GLOBALS['TCA'][$table]['columns'])
+                                       && $GLOBALS['TCA'][$table]['ctrl']['adminOnly'] != 1
+                                       && $GLOBALS['TCA'][$table]['ctrl']['rootLevel'] != 1
+                                       ) {
                                $f_keys = array_keys($GLOBALS['TCA'][$table]['columns']);
                                foreach ($f_keys as $field) {
                                        if ($GLOBALS['TCA'][$table]['columns'][$field]['exclude']) {