Bug #15250
closed
t3lib_BEfunc::blindUserNames() does not work sometimes
Added by Dmitry Dulepov almost 19 years ago.
Updated about 11 years ago.
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
'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.
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
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.
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
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.
Great Dmitry!
Thanks for your efforts,
Sebastian
Hi Dmitry, did you already have time to look into this?
Greets, Sebastian
Deassigning from myself because I am not sure when I can take care of it
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
- Status changed from New to Needs Feedback
- Target version deleted (
0)
- PHP Version deleted (
4)
Hi Dmitry,
is this fixed in newer Versions?
- Status changed from Needs Feedback to Closed
No feedback for over 90 days.
Also available in: Atom
PDF