[BUGFIX] Fix usergroup condition in user TSconfig 51/31151/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Tue, 24 Jun 2014 14:18:59 +0000 (16:18 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 2 Jul 2014 18:02:49 +0000 (20:02 +0200)
usergroup conditions in user TSconfig are currently failing as
the list of groups the user is part of, is not yet compiled when
the TSconfig is evaluated.

This can be fixed by moving the group evaluation some lines upwards,
as this does not influence the remaining code.

Resolves: #59813
Releases: 6.3, 6.2, 6.1
Change-Id: Id3189ea5cd31936bdf538e2bb163ecc2d46ed6a0
Reviewed-on: https://review.typo3.org/31151
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php

index 886e884..e6efc4a 100644 (file)
@@ -1358,6 +1358,15 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                                // Refer to fetchGroups() function.
                                $this->fetchGroups($grList);
                        }
+
+                       // Populating the $this->userGroupsUID -array with the groups in the order in which they were LAST included.!!
+                       $this->userGroupsUID = array_reverse(array_unique(array_reverse($this->includeGroupArray)));
+                       // Finally this is the list of group_uid's in the order they are parsed (including subgroups!)
+                       // and without duplicates (duplicates are presented with their last entrance in the list,
+                       // which thus reflects the order of the TypoScript in TSconfig)
+                       $this->groupList = implode(',', $this->userGroupsUID);
+                       $this->setCachedList($this->groupList);
+
                        // Add the TSconfig for this specific user:
                        $this->TSdataArray[] = $this->addTScomment('USER TSconfig field') . $this->user['TSconfig'];
                        // Check include lines.
@@ -1404,13 +1413,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                        $this->groupData['modules'] = GeneralUtility::uniqueList($this->dataLists['modList']);
                        $this->groupData['file_permissions'] = GeneralUtility::uniqueList($this->dataLists['file_permissions']);
                        $this->groupData['workspace_perms'] = $this->dataLists['workspace_perms'];
-                       // Populating the $this->userGroupsUID -array with the groups in the order in which they were LAST included.!!
-                       $this->userGroupsUID = array_reverse(array_unique(array_reverse($this->includeGroupArray)));
-                       // Finally this is the list of group_uid's in the order they are parsed (including subgroups!)
-                       // and without duplicates (duplicates are presented with their last entrance in the list,
-                       // which thus reflects the order of the TypoScript in TSconfig)
-                       $this->groupList = implode(',', $this->userGroupsUID);
-                       $this->setCachedList($this->groupList);
+
                        // Checking read access to webmounts:
                        if (trim($this->groupData['webmounts']) !== '') {
                                $webmounts = explode(',', $this->groupData['webmounts']);