Joomla 3 Login redirect - works in Login Module but does not working from component login view

Gary picture Gary · Aug 12, 2014 · Viewed 8.1k times · Source

I am working on Joomla 3.x I have a requirement to redirect to a new page after login. I know there is an option in Login Module under module manager, where in we can specify "login Redirection Page". This is working perfectly fine. it is redirecting to the place where i wish to.

However, the issue is - Once User creates a new account ( i have disabled the registration process, so no email links activation is required) user is presented with a Login view (not from module) from component - com_users. Once credentials are supplied, instead of redirecting to the desired page i set in module manager, it goes to profile page of com_users component. index.php/component/users/?view=profile

I need your suggestions to change this default behavior. Is there any place where i can set the redirection page for component com_users, similar to how we have for Login Module? Do I need to go for Joomla core file coding changes? Or Do i need to create Plugin which can fire after OnLoginUser event?

Expecting suggestion from you guys.

Thanks and regards, Gaurav Pandya

Answer

emmanuel picture emmanuel · Aug 12, 2014

In the menu item setup (menu item type -> login form) please check the options tab there is a field that you could set login redirect.

EDIT:

If your login is not connected to a menu please try make an override to: components/com_users/views/login/tmpl/default_login.php line 79:

<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', $this->form->getValue('return'))); ?>" />