I am trying to setup a login redirect auto action based on user language param. On the basis of some of your tutorials this is what I managed to put together but still falling short of my objective:
Trigger: onAfterLogin
User: Automatic
ACL: Everybody
Condition: -
Method: PHP (eval)
and this is the code:
Code:
Global $_CB_framework;
$myId = $_CB_framework->myId();
$cbUser =& CBuser::getInstance( $myId );
if ( ! $cbUser ) {
$cbUser =& CBuser::getInstance( null );
}
$user =& $cbUser->getUserData();
$lang_tag = $user->params('language');
switch ($lang_tag) {
case 'en-EN':
$login = 'index.php?option=com_comprofiler&Itemid=347&lang=en';
break;
case 'es-ES':
$login = 'index.php?option=com_comprofiler&Itemid=350&lang=es';
break;
default:
}
%login is the variable that I see in the cb login module and storing the login redirect url.
Could you take a look at the code and tell me where I am wrong?
Thanks,
adop