Iam using the login module of Joomla. Login and Logout redirects to the pages which are set in the modul settings.
My problem is the status, where a user tries to login with wrong user credentials. In this case, the user will be redirected to component/users/?view=login page. In my case, this page is not in use and also not designed like the rest of the pages. Therefore I would like to redirect the user, after a wrong login, to the previous page.
Does anybody have a clue, how to solve that?
thx
You will need to modify users controller. But to keep it "update proof" you cannot modify the core code, thats why we will make an override:
components/com_users/controllers/
and duplicate a file called user.php
, you can call a new file user2.php
user2.php
file and rename controller class to UsersControllerUser2
templates/YOUR_TEMPLATE/html/mod_login
folder and copy modules/mod_login/tmpl/default.php
file there.<input type="hidden" name="task" value="user.login" />
to <input type="hidden" name="task" value="user2.login" />
$app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
Change $app->redirect
route to whatever you want :)