Project

General

Profile

Actions

Feature #14822

closed

Group membership defined by MM relation instead of text field.

Added by old_Pic2008 over 19 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2005-06-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
4
Tags:
Complexity:
Sprint Focus:

Description

The usergroup memberships for backend and frontend users is currently defined by a comma separated string stored in a binary data field.
This makes getting users from the DB based on what group they belong to cumbersome and inefficient as it requires using the REGEXP operator (more specifically: SELECT * FROM be_users WHERE usergroup REGEXP '(,|^)<group_id>(,|$)';).
Replacing this with a many-to-many relationship in the next major revision of Typo3 would in my eyes be a good thing.

(issue imported from #M1203)

Actions #1

Updated by Peter Niederlag about 19 years ago

yes this would be very nice but does have a hug impact. Hopefully will be adressed in V 5.0

Actions #2

Updated by old_djluc almost 19 years ago

Isn't is possible to keep a modern shadow table:

So we create a MM table, just like the relations have to be in modern extensions. Then we attach a function to the update/insert hook from fe_users. When updating a record the group-assignment will be saved komma seperated in the fe_user.usergroup field but also in the MM table so we can use the values in a normal way, with a nice query.

Actions #3

Updated by Christoph Lemmer over 16 years ago

It also works without REGEX

SELECT * FROM `be_users` WHERE FIND_IN_SET('###groupid###', usergroup)>0

Actions #4

Updated by Peter Niederlag over 16 years ago

thx for the pointer. IMO this is still not a real solution though.

Actions #5

Updated by Alex Widschwendter over 16 years ago

it exists an dbal safe function in class.t3lib_db.php for this purpose.

see function listQuery

Actions #6

Updated by Christian Kuhn over 15 years ago

Resolved, won't fix.

This comma-separated-list of ID's concept is found for several relations throughout the core. I don't expect it to be replaced soon, even if it's not optimal from a database point of view.

For now I resolve this issue with "won't fix" until someone comes up with a working concept (including backwards compatibility) not breaking too much. Feel free to work on this.

Furthermore a be / fe user is usually only member of a small set of group, so we usually don't search an id in a huge list, which is not a perfect, but a practical approach. Extensions still can use real mm relations, though.

Actions #7

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF