Auto Group plugin for Community Builder 1.8 / 1.9 for Joomla 2.5, Joomla 1.7 and Joomla 1.6 allows to assign a Joomla groups to an user depending on the value of a CB field. The check on the field value is done when the user register on site for the first time, and everytime the user profile is modified from the frontend or backend. This allows, as example, to enable multiple user profiles, using Joomla groups as profile type, and CB fields to let users choose their profile type.
Let's assume we need two different user profile types, Downloader and Uploader. We can create two different Joomla groups with the same name.
And use Joomla Access Levels to grant different permissions for each profile (e.g. grant permissions to upload files only for Uploader profile). Now we need to let a user to choose his profile type. Let's create a CB field named "cb_profiletype" of type "select", with three values, Downloader, Uploader and Both.
Once this field is published, the user will be able to choose the profile type in the registration form using this field.
To assign the user to the corresponding Joomla group depending on the value for this field, let's enable Auto Group plugin from Community Builder panel and just configure a few rules (a rule for each line). Rule format is:
fieldname;fieldvalue, ... ,fieldvalue;groupname, ... ,groupname;unassing
Where "fieldname" is the CB field name to check (cb_profiletype in our example), "fieldvalue" is the field value that "trigger" the group assign action, and "groupname" is the Joomla group name to assign the user to. It's possible to specify a list of values and groups separated by a comma. Last field "unassign" can be only true or false (the default when not specified). When this is set to "true" this means the groups specified should also be "unassigned" if the field value is different from the specified one (a group is unassigned only if is not explicitly assigned by another matching rule on a field).
In our example rules are:
With these rules any time the field "cb_profiletype" assume the "Downloader" value, the user is assigned to "Downloader" group, and unassigned from this group if the value is different. Likewise, any time this field assume the "Uploader" value, the user is assigned to "Uploader" group, and unassigned from this group if the value is different. Finally, if the field assume the "Both" value, the user is assigned to both "Uploader" and "Downloader" group. Simple, effective and cheap. The price for the lifetime subscription is only 5€.