[BUGFIX] Excludefieds must exclude admin only tables
authorGeorg Ringer <mail@ringerge.org>
Sat, 3 Mar 2012 13:21:32 +0000 (14:21 +0100)
committerXavier Perseguers <xavier@typo3.org>
Tue, 16 Oct 2012 10:11:31 +0000 (12:11 +0200)
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: Icfa6a9c163d3ee736ab50394741c383351eddd2c
Resolves: #34460
Releases: 4.8,4.7,4.6,4.5
Reviewed-on: http://review.typo3.org/12854
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/class.t3lib_befunc.php

index 07f27bc..6a2e636 100644 (file)
@@ -492,8 +492,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']) {