Include User Groups in predefined List Fields

12 years 1 month ago - 11 years 4 months ago #195459 by newlog
IMPORTANT NOTE - This topic is deprecated topics - See Implementation of the 'Main Group feature' for an update

I am attaching a very simple (6-lines) hack to include User Groups in predefined List Fields.

Actually it is 5 lines for core, plus 1 line per langage file (eg. French in my attachment)

This is very useful indeed, especially with Joomla's new ACL.

This updated version works for all types of install: fresh install or upgrade, with or without sample data

Now one can select the User Group in building CB Lists!

Tested with CB 1.3 to 1.8.x (but the attachment is for 1.8.1)

How-to file: Community_Builder_1.8_Hack_to_include_User_Groups_in_predefined_List_Fields.txt

[EDIT 1-May-2012] Updated to work for all types of install + Typo on _UE_UGROUP corrected

[EDIT 7-Sept-2012] Bug fix: registration in backend did not work properly.

[EDIT 24-Dec-2012] Resources removed as topic deprecated.
The following user(s) said Thank You: webiedesign, ne-u

Please Log in to join the conversation.

12 years 7 hours ago #198617 by newlog
;)

Submitted to the core team !

Please Log in to join the conversation.

11 years 7 months ago - 11 years 7 months ago #209603 by newlog
The above How-to file has been updated.

It fixes the following bug: when registering in backend, the two selections 'Group' (existing) and 'User Group' (added by this hack) were present, a non-desirable feature.

The core team has not shown any interest so far, despite a standard "We are here to help you" in private. Too bad, but things may always change... :huh:

Please Log in to join the conversation.

11 years 6 months ago - 11 years 4 months ago #212508 by newlog
Replied by newlog on topic All about usertypes in CB
Since this contribution is about “usertypes”, a short explaination is perhaps in order.

IMPORTANT BASIC FACTS
  • The “usertype” field in table #__users is a legacy field from Joomla! before 2.5.
  • In a pure Joomla! 2.5 usage, it is either empty, or set to 'deprecated' for a “Super User” (formerly “Super Administrators” before Joomla! 2.5).
    Once set, it is NO MORE UPDATED by Joomla! 2.5 (unless a user becomes, or ceases to be, a “Super User”).
  • Nevertheless, CB DOES UPDATE this field (in a manner described below) AS FAR AS CB USER MANAGEMENT/REGISTRATION IS USED instead od Joomla! 2.5 User Management/Registration.
  • Therefore, as far as CB User Management/Registration is used, and as far as the limitations of the usertype determination by CB are under control (see below), IT MAKES SENSE TO USE THIS FIELD to show the “main group” of the user. This applies especially to CB lists, which prove convenient (for most usages) to display the “main group” of each listed user.
  • Remind that in Joomla! 2.5, the group names, hence the “usertype” field, are LANGUAGE-DEPENDENT strings, depending upon the language USED FOR THE INSTALLATION of Joomla!.
    Thus, for a given user, the “usertype” field does NOT change when loging in with a different language, although the entire site does update for the new language!
USERTYPE MANAGEMENT in CB

The way CB sets the “usertype” field is very simple:
  • If the user is in the “Super User” group (“Super Administrator” before Joomla! 2.5),
    usertype = “Super User” (in EN, or else translated into the installation language, eg. “Super Utilisateur” in FR)
  • Else, if the user is in the “Administrator” group,
    usertype = “Administrator” (in EN, or else translated into the installation language, eg. “Administrateur” in FR)
  • Else, if the user is in the “Manager” group,
    usertype = “Manager” (in EN, or else translated into the installation language, eg. “Gestionnaire” in FR)
  • Else
    usertype = the LAST group in the user's group list (translated into the installation language)
Now one may wonder what “the last group” precisely means...

VERY IMPORTANT WARNING

The “last” group in CB usertype determination is actually the “lowest selected group in the list”, ie. the selected group of highest order number in the list of available user groups.

This is a user-interface notion, and HAS NOTHING TODO WITHIN ANY HIERARCHICAL POSITION of the group with respect to the other groups.

Consider for instance the following two selection cases, based on the same user-interface presentation, where means the group is selected:

Case A:
	group 1
group 11
group 2
group 21

Case B:
	group 1
group 11
group 2
group 21

Here the user will have usertype “group 2” in case A and “group 21” in case B, which is a non-symmetric determination. One would expect the usertype to be the same if the ORDER is changed, ie. if the presentation is changed to
	group 2
group 21
group 1
group 11

Clearly, with this new presentation the usertype determination is the same in case B but NOT in case A !!!

==> ONE MUST BE AWARE OF THIS LIMITATION (as of 1.8.1) WHEN CONSIDERING THE usertype IN CB.


For a full acount of this issue, see Usertype management in CB.

[EDIT 24-Dec-2012] Resources removed as topic deprecated.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.194 seconds

Facebook Twitter LinkedIn