Image Caption

Thursday, August 9, 2012

Joomla redirect after login [Custom Url]


Step:1
Open the file: home directory/components/com_users/controllers/user.php


Step:2
Search the below code near line:61

// Perform the log in.
if (true === $app->login($credentials, $options)) {
// Success
$app->setUserState('users.login.form.data', array());
$app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));
} else {
// Login failed !
$data['remember'] = (int)$options['remember'];
$app->setUserState('users.login.form.data', $data);
$app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
}


Step:3

After login set a Custom redirect

$app->redirect('index.php?option=com_chronocontact&chronoformname=Contact&Itemid=5&lang=en');

Replace the below line with above code

$app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));


4 comments:

csmidhu said...

Hi Selva Kumar, it's worked for me thanks for sharing.

Keep posting


Best Regards,
Mithun C S

Anonymous said...

Thanks a lot. Your information is pretty much easier than others.

Anonymous said...

Thanks very much!!

Works perfectly.

MRK said...

Thanks, the information was really helpful