[BUGFIX] Excludefieds must exclude admin only tables
authorGeorg Ringer <mail@ringerge.org>
Sat, 3 Mar 2012 13:21:32 +0000 (14:21 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Fri, 9 Mar 2012 06:58:11 +0000 (07:58 +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: Id9ed03ad33c2c6a83bac44d6d08f36483762ae6a
Resolves: #34460
Releases: 4.8,4.7,4.6,4.5
Reviewed-on: http://review.typo3.org/9337
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
t3lib/class.t3lib_befunc.php

index 186d221..25cd8ff 100644 (file)
@@ -488,8 +488,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']) {