hi i wrote a module for user page generation. After login the path goes to users/[user-name] and i want to customize it using my module. how to handle it?
+1
A:
With hook_form_alter you can create a submit handler for the login form, and in it set $form_state['redirect'] to where you want the user to be redirected to when the user logs in.
googletorp
2010-06-09 08:29:48
A:
You can implement a hook_user fonction like this
function mymodule_user($op, &$edit, &$account, $category=NULL) {
switch ($op) {
case 'login': // user just logs in...
// Modify $_REQUEST['destination'];
// but no drupal_goto in order
// to avoid problem with other hook
break;
}
}
More here : http://www.youtube.com/watch?v=UoeFTr124jw
Brice Favre
2010-06-09 08:52:27
Using drupal_goto in a hook, is a big NO NO, it'll disrupt other modules implementing hook_user.
googletorp
2010-06-09 09:41:41
Ok so it's better to use $_REQUEST['destination']. I will change my post.
Brice Favre
2010-06-09 10:55:26
+3
A:
You can use Login Toboggan to set a login destination. There are a few modules available for login redirecting without having to code.
To customize the look and feel of the user profile page, you can implement that through a TPL with CSS, or you can use Views to create Content Panes in conjunction with Panels, and override the user/% profile view.
Kevin
2010-06-09 14:21:06