[BUGFIX] Fix usergroup condition in user TSconfig 14/31114/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, 25 Jun 2014 19:07:06 +0000 (21:07 +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/31114
Reviewed-by: Martin Wiederkehr
Tested-by: Martin Wiederkehr
Reviewed-by: Christoph Buchli
Tested-by: Christoph Buchli
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']);