Hi,

I would like to set role for anonymous user.
For example :

The anonymous visit page A => set role A for this anonymous
The anonymous visit page B => set role B for this anonymous
...

And I would like to manage this role like the other (normal role).

There is a module for this ?

I would like to do zero dev for this.

TIA for you help

Comments

alinouman’s picture

what are you trying to do plz can u explain more?

kapik’s picture

I want to display different block for different anonymous users for the same URL.
So I have to distinguish users.

For example :

Anonymous user A go from page 1 to page 3 then I display block X.
Anonymous user B go from page 2 to page 3 then I display block Y.

So I would like to assign a different role for these anonymous users to control blocks.

Do you understand ?

cfox612’s picture

Why not just use query string variables? Page one's link would look like: page/3?[id]=A, then Page two would look something like: page/3?[id]=B. The block would then display based on the id value (or whatever you call it).

kapik’s picture

I would like clean URL.

And it's not only a block restriction.

I would like to control the menu item (with the module 'Menu Per Role')

cfox612’s picture

How would you decipher one anonymous user from another?

kapik’s picture

When user visit a specific page.

Take the example :

Anonymous user A go from page 1 (he take the AA role) to page 3 then I display block X (thanks to his AA role).
Anonymous user B go from page 2 (he take the BB role) to page 3 then I display block Y (thanks to his BB role).

These roles allow to display differents block and to restrict item visibility per role.

So I'm looking for solution to assign role to an anonymous user but I think it's impossible.

(The solution can be developed by me)

cfox612’s picture

You have no way of differentiating one anonymous user from another, therefore you cannot assign some anon's one role, other's a second, and the rest none.

Instead of regular links you could use a form (the front end user would not know the difference) and pass through hidden post variables to determine which block is shown (if you want keep the URL's clean).

kapik’s picture

Ok. I understand.

Any way to use cookie to do this ? But I can't use it to allow an article, block or more...

cfox612’s picture

You can use PHP Sessions, but you would need javascript to to active an onclick event for the link, and set up the function in the template.php file.

kapik’s picture

Hi,

I am interested by this solution (form).

But how to decide to show or hide block with post var ?

cfox612’s picture

If the block is a view you can use the views_php module to add a Global: PHP field to check which value is present, then show/hide.