Bug #59813
closed[usergroup] BE condition in TSconfig not working
100%
Description
Having troubles with the [usergroup] BE condition in TSconfig as it's not working at all. I have analyzed the code a bit and found out that the $groupList string in the ConditionMatcher.php is always empty, therefore the if clause is never true
typo3/sysext/backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php
$groupList = $this->getGroupList(); return "" (Line 63)
Nevertheless, [usergroup = *] is still working as it's no releated to $groupList (Line 66)
A bit of more debuging shows, that the $this->userGroupsUID array is already empty
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
$this->groupList = implode(',', $this->userGroupsUID); (Line 1425)
I quit analyzing there as the whole fetchGroupData function is really complex.
Updated by Markus Klein over 10 years ago
Hi!
Can you please post some sample TSconfig you've been using?
Updated by Markus Klein over 10 years ago
And can you maybe debug once more and have a look at line 1355 (on current master)
$grList = $this->db->cleanIntList($this->user[$this->usergroup_column]);
What is the value of $this->usergroup_column
and $this->user
?
Updated by Martin Wiederkehr over 10 years ago
Hi Markus
Hopefully this helps. Switched to master: commit 143c274496c566f80e3481050bcd54408e3fba58
UserTS in file, added with ExtensionManagementUtility::addUserTSConfig. I also checked the condition directly in the record (even it doesn't make any sence there) => same behaviour. There are more userTS values in the end, but I checked it with that sample.
options { clearCache { system = 1 } } # adminUser = 0 works fine //[adminUser = 0] [usergroup = 4] options { clearCache { system = 0 } } [global]
User CM [uid1] - Default Group [uid4] --> Subgroup 1 [uid1] --> Subgroup 2 [uid2]
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php: 1355
this->usergroup_column = "usergroup" this->user => usergroup = "4" this->user => usergroup_cached_list = "1,2,4" $grList = "4"
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php: 1412
this->userGroupsUID => 0 = 1; 1 = 2; 2 = 4 this->groupList = "1,2,4" DB: usergroup_cached_list = "1,2,4"
typo3/sysext/backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php: 50
$string = "usergroup = 4" $key = "usergroup" $value = 4 $groupList = ""
Updated by Markus Klein over 10 years ago
I found the reason.
The userTSconfig is evaluated before the groups are evaluated.
Evaluating now, if we can change that without side effect.
Updated by Markus Klein over 10 years ago
- Status changed from New to Accepted
- Complexity set to medium
Updated by Gerrit Code Review over 10 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31114
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31151
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31152
Updated by Markus Klein over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d7a2a8ac075650bfde32c2dc8dcb040ad95cec2c.