Hello,

What I have:
I have a website where the content for anonymous users can be viewed either in Dutch or French. Logged in users can only view the content in English. There is a login form on every page.

What I want:
When a user logs in from say: /nl/example-page , the page when logged in will be the same, meaning the /nl/example-page still showing content in Dutch. Is it possible to fire a language switch rule when logging in?

Is this possible with the rules module? If not, are there any other ways to achieve this?

Thanks in advance.
Cheers,
Danny

Comments

pol’s picture

Component: Rules Core » Rules Engine

I don't think this is a matter of switching because you disallow one language.

I think a custom hook_node_access() will do the trick.

mitchell’s picture

Status: Active » Fixed

Yes, you could potentially switch the user's locale, but you would then need to prevent them from changing it themselves. Disable user language looks like a good choice.

The next step would be to wrap user_preferred_language() in an action. See theme_rules for an example of how that can be done, but more importantly, see http://drupal.org/node/298522.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.