Guests and Groups

Permalink
Hi All

I have a requirement to be able to add guest users to custom groups...

The senario is that a guest user should be able to be in a regional group (EMEA, Americas etc) and blocks can be shown/hidden by group permissions.

I have tried adding the group to the session but this doesn't seem to register.

Does anyone have any ideas?

Cheers

5fly
 
Ekko replied on at Permalink Reply
Ekko
You may find these helpful

This add-on allows you to show certain blocks only to guests, solving the first half of your problem,
http://www.concrete5.org/marketplace/addons/guest-views/...

This add-on re-directs users based on location solving the other half of your problem
http://www.concrete5.org/marketplace/addons/country-redirect/...

All site visitors that are not logged in are considered guests so combine the above and you should get what your looking for.
5fly replied on at Permalink Reply
5fly
Thanks. Although Im not sure this solves the issue....

If we ignore the region issue... there might be another senario where by a guest might need to be in different groups...

So I might have a block which only someone in the "SpecialUser" group can see...

If that user is logged in I can set them into the "SpecialUser" group.

If the user is just a guest, I can't add them to that group. Therefore the block that has that permission (only show to someone who is a guest AND a "SpecialUser") won't show...

I need to work out how to add groups to guest users?

Thanks again.
Ekko replied on at Permalink Reply
Ekko
If they are not logged in how will your site know which group they belong ? Ip address ?

The country redirect solves location issues, but I dont think there is anything that will help with special guest user types defined by "unknown" or "special" as there needs to be a definitive way for the system to recognize the user.

Someone else may have some ideas though, hold in there.
5fly replied on at Permalink Reply
5fly
So looks like I've found a work around...

If you add the following code to your site_post.php you can add any groups to a guest user:

$_SESSION['uGroups'][yourGroupID][yourGroupName];
$ug = $_SESSION['uGroups'];
$u->uGroups = $ug;
$entities = PermissionAccessEntity::getForUser($u);
$_SESSION['accessEntities'] = $entities;