Closed (fixed)
Project:
Login Destination
Version:
5.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2007 at 14:56 UTC
Updated:
5 May 2008 at 03:05 UTC
I have a number of different roles on my website. I only want to redirect certain log ins based on their user roles - each role to its individual page (and 4 different roles to one specific page). I'd rather this not be dependant on the uid numbers seeing as future years the specific people will be different uid numbers, but the roles will be the same (seeing as that could be changed easily).
Comments
Comment #1
Alex Regenbogen commentedJust subscribing, I wish to accomplish the very same thing....
If I manage to solve it using a snippet for Redirection Condition, I'll post it here...
Update: I've used a PHP snippet for URL destination... I think with a little puzzling you'll be able to tackle your problem as well.
The above code works for me, as I have given anonymous users the possibility to register for an account on their own, but in order to gain access to certain area's of the site they need approval from an administrator. (which then gives them additional roles if needed)
A user that registers him/herself gets redirected to the front-page, and any logged in user that has been granted additional rights will get redirected to their 'special' page...
If you we're to go thru the $user-roles, and check if a certain role was present, you will be able to detect and redirect accordingly..
Comment #2
JStarcher commentedThat's kinda a hacky way of doing it in my opinion. Here is the better way:
and of course you can extend that if you want to test for multiple roles and such.
Comment #3
Sakrecoer commentedPerfect thank you!
And for all the noobs like me out there, here is a translation
replace *special users* with the role name.
to create a different redirection for another specific role, you just need to copy-paste this section of the code:
between the previous *if*'s closing } and the *else* thingy....
edit- and of course, paste the snippet in the "URL destination settings" window, not the "Redirection condition settings".
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
geshan commentedwhat do I do if I want to redirect "authenticated users" to the page they logged in from. Meaning if they were viewing a page(or any other content type), say /node/xxx , they click login which will take them to /user but after login I want the "authenticated user" to be redirected to /node/xxx from where s/he logged it. How to I do it?