After user logged in, redirect them to custom page (dashboard) rather than the default user account page in Drupal (user). For users with admin role, redirect to something like (admin/dashboard).
Modules available:-
- logintoboggan - Sadly, it only work upon new registration and not when existing members logged in.
- login_destination - Work, except that it conflict with Content Profile module.
So I proceed with implementing some custom code, copying the trick used in user.module which used
menu_set_active_item('dashboard')
and menu_execute_active_handler()
to render a page for a given request. This work perfectly because it does not use redirect such as in login_destination which would stop script execution, causing some hook and code not fired as in the bug with Content Profile module. This however would only work for real path defined in hook_menu.
No comments:
Post a Comment