Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

Include User Groups in predefined List Fields

  • newlog
  • newlog
  • OFFLINE
  • Posts: 35
  • Thanks: 6
  • Karma: 1
12 years 8 months ago - 11 years 11 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.
Last edit: 11 years 11 months ago by newlog.
The following user(s) said Thank You: webiedesign, ne-u

Please Log in or Create an account to join the conversation.

  • newlog
  • newlog
  • OFFLINE
  • Posts: 35
  • Thanks: 6
  • Karma: 1
12 years 7 months ago #198617 by newlog
;)

Submitted to the core team !

Please Log in or Create an account to join the conversation.

  • newlog
  • newlog
  • OFFLINE
  • Posts: 35
  • Thanks: 6
  • Karma: 1
12 years 2 months ago - 12 years 2 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:
Last edit: 12 years 2 months ago by newlog.

Please Log in or Create an account to join the conversation.

  • newlog
  • newlog
  • OFFLINE
  • Posts: 35
  • Thanks: 6
  • Karma: 1
12 years 1 month ago - 11 years 11 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.
Last edit: 11 years 11 months ago by newlog.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum