Bug #15250

t3lib_BEfunc::blindUserNames() does not work sometimes

Added by Dmitry Dulepov almost 14 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2005-11-30
Due date:
% Done:

0%

TYPO3 Version:
4.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)

1960-usergroup_cached.patch View (4.73 KB) Administrator Admin, 2010-03-05 22:41


Related issues

Related to TYPO3 Core - Feature #17630: gr_list concept needs to be improved New 2007-09-27
Related to TYPO3 Core - Bug #27303: t3lib_BEfunc::blindUserNames might use wrong group list collection Closed 2011-06-08

History

#1 Updated by Dmitry Dulepov almost 14 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.

#2 Updated by Sebastian Kurfuerst almost 14 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

#3 Updated by Dmitry Dulepov almost 14 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.

#4 Updated by Sebastian Kurfuerst almost 14 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

#5 Updated by Dmitry Dulepov almost 14 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.

#6 Updated by Sebastian Kurfuerst almost 14 years ago

Great Dmitry!
Thanks for your efforts,
Sebastian

#7 Updated by Sebastian Kurfuerst almost 14 years ago

Hi Dmitry, did you already have time to look into this?
Greets, Sebastian

#8 Updated by Dmitry Dulepov over 11 years ago

Deassigning from myself because I am not sure when I can take care of it

#9 Updated by Georg Ringer almost 10 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

#10 Updated by Georg Ringer over 9 years ago

patch now attached

#11 Updated by Alexander Opitz over 6 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?

#12 Updated by Alexander Opitz about 6 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Also available in: Atom PDF