Joomla 3: Redirect to same page after successful loginPublished: Tuesday, 21 July 2020 03:18 Written by Ogri Hits: 1722
On the site, authorization occurs through the mod_login module. In the module settings, the option Login Redirection Page is set to Default. After entering the correct username and password, however, Joomla redirects to a variety of places, depending on which extension owns the currently active page. Sometimes it redirects to the site root, other time to a category blog. It's inconvenient. When a user exits (redirection option is also Default), the page does not change, everything is good.
I had to dig around and find a place in the code where the redirect is implemented. It was found not in the authorization module, but in the com_userscomponent. Namely, in the file components\com_users\controllers\user.php. And a small change in its code resolved the issue.
The login() function has been modified. Here is the original one:
public function login() { $this->checkToken('post'); ...................... $app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false)); }
And now look at the changed one.
public function login() { $this->checkToken('post'); ...................... //comment out default redirect // $app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false)); //redirect to the same page $return = $input->get('return', '', 'BASE64'); $return = base64_decode($return); $app->redirect(JRoute::_($return, false)); }
As you can see, the last line is commented out and three new lines have been added instead. The logic is taken from the next function, logout().
It is unclear what prevents the developers from fixing this discrepancy. Perhaps it, like many others, will be fixed in Joomla 4.
Latest News
-
Tuesday, 21 July 2020 03:18
Joomla 3: Redirect to same page after successful login -
Saturday, 30 December 2017 16:11
Joomla: how to add your own language constants or override existing ones -
Thursday, 30 November 2017 23:27
Joomla: Integrate reCAPTCHA v2 (NO CAPTCHA) into JComments -
Saturday, 25 June 2016 15:33
Unified filtering of mod_jcomments_latest module's output -
Thursday, 17 September 2015 16:23
Post an illustrated Joomla-site article on Facebook using OG-tags
Articles Most Read
-
118557
Migrating from Joomla 1.5 to Joomla 2.5. Part 2-1. Transferring jDownloads and jComments -
49281
Joomla: Integrate reCAPTCHA v2 (NO CAPTCHA) into JComments -
34509
Editing animated GIF-images in Photoshop CS3 -
31214
Migrating from Joomla 1.5 to Joomla 2.5. Part 2-2. Template, editor, and other extensions -
29604
Social Media Buttons in Joomla 2.5
Login
Guest Column
Recent comments
-
Joomla: Content filtering by articles, categories and components
-
먹튀검증업체 14.04.2021 18:00
-
-
Joomla: Integrate reCAPTCHA v2 (NO CAPTCHA) into JComments
-
먹튀검증커뮤니티 14.04.2021 15:40
It's great that you are getting ideas from this piece of writing as well as from our argument made ...
-
промокод на доставку 09.04.2021 12:48
Промокод на бесплатную доставку очень популярен, хотя сейчас, промокод на доставку: http://1-mecto.ruверное ...
-
-
Joomla: Merge two sites into one using component J2XML
-
промокод перекресток 07.04.2021 13:36
Промокод может быть однократным (один покупатель — одна покупка) или многократным (и сам покупаешь ...
-
-
Migrating from Joomla 1.5 to Joomla 2.5. Part 2-1. Transferring jDownloads and jComments
-
промокоды вк 11.04.2021 06:36
Промокод может быть однократным (один покупатель — одна покупка) или многократным (и сам покупаешь ...
-
афиша промокод 10.04.2021 15:05
Промокоды — отличный способ привлечения новых клиентов интернет-магазинами, повышения их лояльности ...
-
промокод эльдорадо 08.04.2021 13:57
Промокоды — отличный способ привлечения новых клиентов интернет-магазинами, повышения их лояльности ...
-
промокод вулкан 08.04.2021 12:13
Скидочные купоны есть нескольких вариантов: купон с процентом скидки, купон на определенную сумму ...
-
промокоды импакт 07.04.2021 07:13
Промокоды — отличный способ привлечения новых клиентов интернет-магазинами, повышения их лояльности ...
-
-
Unified filtering of mod_jcomments_latest module's output
-
промокод спортмастер 08.04.2021 13:03
В интернете есть много сайтов, которые собирают промокод спортмастер: http://promokodmag.ruы от ...
-
Read more...