how to redirect user after login
how may i redirect the user to frontpage, exactly after user login, not when the user recieve a 403 error, when the user log in, always send him to frontpage! how can i do this! some module? any modification to user module ? -- ---------------------- Aldo Martinez Selleras Administrador del Nodo CITMATEL GND Camaguey Tel: 32-291661 E-mail: aldo@caonao.cu Linux User #364356
Check this http://drupal.org/project/login_destination On Wed, Nov 19, 2008 at 2:40 PM, Aldo Martinez Selleras <aldo@caonao.cu>wrote:
how may i redirect the user to frontpage, exactly after user login, not when the user recieve a 403 error, when the user log in, always send him to frontpage!
how can i do this! some module? any modification to user module ?
-- ---------------------- Aldo Martinez Selleras Administrador del Nodo CITMATEL GND Camaguey Tel: 32-291661 E-mail: aldo@caonao.cu Linux User #364356
-- Khalid M. Baheyeldin 2bits.com, Inc. http://2bits.com Drupal optimization, development, customization and consulting.
On 19-Nov-08, at 2:54 PM, Khalid Baheyeldin wrote:
Check this http://drupal.org/project/login_destination
That module works well, a +1 from me.
not when the user recieve a 403 error
Our users have found the customerror for 403's to be really useful by adding the following PHP snippet: <?php global $user; if ($user->uid == 0) { print '<p>If your user account has access to this page, <a href="/ user?' . drupal_get_destination() . '">log in with your user account</ a>.</p>'; } ?> That way when there's a 403 they get redirected back to the page they were trying to access. The above is not really "best practice", it should probably call l() or url() so it works when clean URL's are disabled. --Andrew
Aldo Martinez Selleras wrote:
how can i do this! some module? any modification to user module It basically boils down to changing the form action attribute to the appropriate value and handling the login credentials for the form submission. -mf
I would look to drupal_redirect_form for answers... http://api.drupal.org/api/function/drupal_redirect_form/6 for the lazy. form_alter in a 'redirect' for user forms in a custom module... On Wed, Nov 19, 2008 at 2:57 PM, Michael Favia <michael@favias.org> wrote:
Aldo Martinez Selleras wrote:
how can i do this! some module? any modification to user module
It basically boils down to changing the form action attribute to the appropriate value and handling the login credentials for the form submission. -mf
participants (5)
-
Aldo Martinez Selleras -
Andrew Berry -
Darrel O'Pry -
Khalid Baheyeldin -
Michael Favia