Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


Chameleon 2.59: Dynamic User Groups

Chameleon 2.59: Dynamic User Groups

Key new feature: Dynamic User Groups.

I'm often asked if Chameleon can control some aspect of a 3rd-party component, e.g. restricting downloads in a download component, or certain item types in Zoo or SOBI2 etc. Sometimes this is easy if it means restricting access to the entire page, but other times it means hacking the component, doing a find-and-replace on the HTML of the page, or it just isn't possible.

Often, the thing that people want to control already has access controls (access levels / user groups), but of course these only operate once someone is logged in, and providing that they have been added to that group manually.

That got me to thinking... if only there was some way to dynamically add someone to a user group, even if they are not logged in yet, then you could use these access controls to restrict access accordingly.

So now, Chameleon can dynamically add any user, whether logged in or not, to any arbitrary user group. It can also remove someone from a user group. The new assignment lasts for the rest of the user's session.

Let's look at a concrete example.

Site "example.com" runs a web site with audio, video and bibliographical resources for a particular medical discipline. Most of the resources are available to the public, but the video need to be "subscriber only". Except... the owners also want to provide a "back door" for certain users to be able to access the full resources without having to log in to the site.

The Joomla site uses the Zoo component with a custom "app" backend that caters for bibliographical & video resources. It's possible to set the "Access Level" for the videos themselves (just part of the page). Previously this was set to "Registered" meaning only Registered users could watch the video.

Here's what we did to allow users coming from a specified link on another site to view the full resource including video:

1 - Created a new user group called "Transfer"
2 - Created a new View Level called "Transfer and Registered" which contains both user groups "Transfer" and "Registered"
3 - In the video app in Zoo, set the Access Level for the video viewing to "Transfer and Registered"

Then in Chameleon:
4 - created a rule that detects the Referrer URL of the special referring page, and the specific link URL used (eg. http://example.com/?code=secretcode)
5 - in the Action for this rule, "Add group 'Transfer' "

Now when someone follows the link from the "link-page" to example.com, Chameleon recognises that this is a special user, and adds them to the Transfer group. This makes the user part of the "Transfer and Registered" Access Level. Logged-in users are also automatically part of this Access Level.

... and because the users are part of that Access Level, they all get to watch the videos.

When Chameleon adds someone to a user group, this is active for the rest of the user's session. It's not stored as part of the user's user record in the database – guests don't even have a user record so it can't be stored. It's a purely dynamic user group allocation.

What else could you use this for? Here are some ideas:
1 - Control visibility of modules
2 - Control downloads in components that allow different items or categories to be downloaded by certain user groups or access levels
3 - Control visibility of shopping cart items in components that allow products or categories to be viewed/purchased by different user groups or access levels.
4 - can you think of more?

This allows some very creative website personalization to take place. For example you could add people to the user group on the basis of:

- what browser they are using
- what country they are from (GeoIP detection)
- what site they linked from
- whether they have visited a particular page on your site (i.e. open up new areas on your site after a user has visited a particular gateway page or performed some action)
- how long it was since their last visit
- time of day or date of the year / seasonal

Can you think of any more creative uses? Please add your reply below!

Buy now: http://www.metamodpro.com/chameleon/shop17
Information: http://www.metamodpro.com/chameleon/chameleon
Release notes: http://www.metamodpro.com/chameleon/mtp-release-notes

For existing customers of Chameleon 2.x (for Joomla 2.5 and above only): to upgrade your version of Chameleon:

  • Go to your “My Account” page
  • Log in with your username and password
  • Click on “View” next to your confirmed order
  • Scroll down past the invoice until you see the Order Items section
  • Click on ChameleonX-X.zip to download it.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Total Posts Today:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky