Hi,

I have a problem with redirecting to different pages after user login.

First, I set the front page to be "location/1"

Then, the idea is that each user has a location information, after the user login, I want the page be redirected based on the user location information. So, I implement the hook_user:

function mymodule_user($op, ....){
switch($op){
case 'login':
$loc = $user->location;
drupal_goto("location/$loc");
}
}

However, it does not work. the pages always go to 'location/1". And of course, $user->location shows me the current value.
I am thinking that the hook_user first send the user to "location/$loc", then the "front page strategy" bring the user back to "location/1".

How to solve this? Thansk.

Hang

Comments

rkdeveloper’s picture

foredoc’s picture

Thanks, it works great.