1
votes

I am gonna try my best to describe our problem. Hopefully someone way smarter than us can figure this out. One of our Joomla sites has some content that requires login, simple enough right? The normal login functionality works great. Once logged in we could see the locked down content. But lets say we have a direct link to a "locked" page, once logged in, the page redirects to the homepage (index.php).

Natively Joomla 2.5 should retain the origin link, and redirects to that link, not back to index.php. So if my link was homepage.com/k2item1, after login it should go to k2item1 not index.php. I have tried turning off all modules and plugins just in case something is overriding the native login functionality from links. I have checked the .htaccess file for redirects. I have tried both settings in SEO settings "Use URL rewriting", Yes/NO doesn't matter. I have tried renaming the override folder (html) in our template folder, so no overrides should happen. Nothing. The link still redirects back to index.php. I have even tried printing out the form/user object to see if the origin link was there, aka "return", and the link is in there, but after login, still index.php instead of the string "return". Any ideas will be greatly appreciated. Maybe there are plugins out there that would help ensure links do not redirect to home page?

1
update: components/com_users/controllers/user.php Finally tracked down where it is breaking. line 35: $data['return'] = base64_decode(JRequest::getVar('return', '', 'POST', 'BASE64')); This is not getting the form "return" aka link. It is "/" every time. I set $date['return'] manually to the desire internal link and works. Any ideas on how to fix this would be greatly appreciated. Hate hacking the core, but I just need to get this done (sigh).CS Studios

1 Answers

0
votes

Override the component: mod_k2_user/login.php and edit the hidden input name "return".

<input type="hidden" name="return" value="<?php echo base64_encode(JURI::current()) ?>" />