Active
Project:
Login Destination
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2011 at 10:43 UTC
Updated:
28 Jun 2011 at 18:17 UTC
Hello,
I want to redirect the user depeding on their role, if no destination is specified (if they log in from front page)... if they have already entered a URL and logged after, they should preserve destination....how do I have to insert this condition into my php snippet*
I tried to check whether 'destination' isset, but this did not work...
Best regards
Adriana
* this works, but I want to add preserving destination if a specific was chosen before login...
global $user;
if (in_array('SchuelerIn_MNG',$user->roles)||in_array('SchuelerIn_KS',$user->roles)) { return 'fuer_schuelerinnen'; }
elseif (in_array('Lehrperson',$user->roles)) { return 'fuer_lehrkraefte'; }
else { return 'destination'; }
Comments
Comment #1
mithy commentedYou have to understand that the destination param is always set in the login block, on the front page it is a destination to front page. I would add a condition for the current page, e.g. using the $_GET['q] param.
Hope this helps.