Joomla 3: Redirect to same page after successful loginPublished: Tuesday, 21 July 2020 03:18 Written by Ogri Hits: 6394
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
-
131602
Migrating from Joomla 1.5 to Joomla 2.5. Part 2-1. Transferring jDownloads and jComments -
63460
Joomla: Integrate reCAPTCHA v2 (NO CAPTCHA) into JComments -
37282
Editing animated GIF-images in Photoshop CS3 -
35936
Migrating from Joomla 1.5 to Joomla 2.5. Part 2-2. Template, editor, and other extensions -
31481
Migrating from Joomla 1.5 to Joomla 2.5. Part 1. Transferring content
Login
Guest Column
Recent comments
-
Custom 404 error page in Joomla 2.5
-
supplement 28.04.2022 09:22
-
joker123 25.04.2022 08:17
For latest news you have to go to see the web and on the web I found this web site as a finest web ...
-
gt options binary 19.04.2022 08:25
We will teach you how to earn $ 7000 per hour. Why? We will profit from your ...
-
-
Joomla 3: Redirect to same page after successful login
-
ceri 138 17.04.2022 10:25
Awesome! Its genuinely remarkable piece of writing, I have got much clear idea regarding from this ...
-
-
Joomla: Merge two sites into one using component J2XML
-
ceri 138 17.04.2022 00:07
What a stuff of un-ambiguity and preserveness of precious familiarity regarding unexpected feelings.
-
ceri138.com 16.04.2022 14:43
This site certainly has all the information and facts I needed about this subject and didn't know who ...
-
-
Migrating from Joomla 1.5 to Joomla 2.5. Part 1. Transferring content
-
ceri138.com 05.05.2022 06:27
Excellent blog here! Also your site loads up fast! What web host are you using? Can I get your affiliate ...
-
ceri 138 23.04.2022 16:08
Hi there, I enjoy reading all of your post. I wanted to write a little comment to support you.
-
-
The structure of internal links within Joomla site
-
Ceri138 16.04.2022 18:56
I was very pleased to discover this page. I want to to thank you for ones time for this particularly ...
-
-
Unified filtering of mod_jcomments_latest module's output
-
Find Out More 15.05.2022 01:49
Howdy exceptional blog! Does running a blog like this require a lot of work? I have no understanding ...
-
Read more...