Bug #15250
closedt3lib_BEfunc::blindUserNames() does not work sometimes
0%
Description
This function does not work properly if the follwing two conditions were met:
- a list of user's groups were changed
- user did not log on to BE after group changes and before t3lib_BEfunc::blindUserNames was called
The problem is that t3lib_BEfunc::blindUserNames uses 'user_group_cached' field from be_user. This field is absolutely identical to 'usergroup' field (except database type which is irrelevant in this case). 'user_group_cached' is set to the value of when user 'usergroup' when user logs in. Thus fields in be_user record is not in sync.
I have no solution for this problem. Probably user_groups_cached should not be used at all.
(issue imported from #M1960)
Files
Updated by Dmitry Dulepov almost 19 years ago
'user_group_cached' above should read 'usergroup_cached_list'.
'usergroup_cached_list' in fact contains full list of user's groups incliding subgroups from other groups.
Updated by Sebastian Kurfuerst almost 19 years ago
Hi,
a possible solution could be writing a function for updating the usergroup_cached_list and do this on saving a BE user record. What do you think?
Greets, Sebastian
Updated by Dmitry Dulepov almost 19 years ago
I think user record is edited through alt_doc.php (as any other record). Thus it is hard to know when it is saved without introducing a userFunc for the table. This function should be called when record is saved.
Updated by Sebastian Kurfuerst almost 19 years ago
Hi,
another idea might be to check when the cached user group list is used in TYPO3 and check where it gives performance gains. - So maybe we could get rid of this field generally and create a function $BE_USER->getUserGroups or so?
Just some thoughts, and thanks Dmitry for taking care of this :-) (And btw welcome to the core team!)
Greets, Sebastian
Updated by Dmitry Dulepov almost 19 years ago
Thanks, Sebastian :) Such function exists in one of t3lib_user*.php files, it only needs to be called. I think I will look where else "usergroup_cached_list" is used and see how we can do fix it with minimal effort.
Updated by Sebastian Kurfuerst almost 19 years ago
Great Dmitry!
Thanks for your efforts,
Sebastian
Updated by Sebastian Kurfuerst almost 19 years ago
Hi Dmitry, did you already have time to look into this?
Greets, Sebastian
Updated by Dmitry Dulepov over 16 years ago
Deassigning from myself because I am not sure when I can take care of it
Updated by Georg Ringer almost 15 years ago
all this would need is the following code:
if ($table == 'be_users') {
$tempBeUser = t3lib_div::makeInstance('t3lib_userAuthGroup'); // New backend user object
$tempBeUser->user_table = 'be_users';
$tempBeUser->setBeUserByUid($id);
$tempBeUser->fetchGroupData();
}
called in the tcemain, e.g. with the hook afterDatabaseOperations
I just don't know where to place the code
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0) - PHP Version deleted (
4)
Hi Dmitry,
is this fixed in newer Versions?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
No feedback for over 90 days.