1

I've had a look through the existing posts relating to my issue but haven't found one relevant, please feel free to point them out to me if I have missed one.

I have restricted access pages, thus have set these up on a hidden menu with 'registered' access, then set up a menu item alias set to 'guest' so that the link is visible in the menu - all good so far. The user clicks the link and is presented with the Login Page.

The problem being now that once the user actually logs in, there is no redirect. Obviously, I would like them to be redirected to the page they originally tried to access that was previously restricted prior to login.

I was sure this was standard behaviour in Joomla, but now I'm back tracking trying to figure this out. There are a number of these links that I need to set up, so I'm hoping one of you wonderful people will be able to point me in the right direction.

The site is in development and is currently running J3.7.3 - I cannot update it at present due to some incompatible overrides for Mosets and JomSocial.

The site can be viewed [here][1] - The menu item I am testing with is under Social > Safety Guidelines in the footer of the site.

I look forward to your input.

Regards D

  • If you give your users a link to a login page, then the last page your users were before they login is that login page. – FFrewin Dec 8 '17 at 18:04
  • I haven't, the link is to a menu Item alias for a restricted page as explained in this article: docs.joomla.org/Auto_redirect_guests_to_login Thus, the user clicks to access a restricted page, hence is redirected to the login page, after login they need to be directed back to the restricted page as they now have access. – Dtorr1981 Dec 8 '17 at 18:14
  • That's something wrong with your configuration because I can say for sure that this is a default Joomla functionality out of the box. – Alexandr Jan 24 '18 at 8:52
  • The site uses Mosets Tree and JomSocial so I am assuming there is a conflict somewhere. I have however found a plugin which has resolved the issue. I will add this as a solution. – Dtorr1981 Jan 25 '18 at 16:53
0

You should be able to make a regular menu item that is public, but point to content that is private. So if it was a single article, that would be set to Registered but menu item public.

That should cause the normal Joomla login screen and redirect.

  • This is not the case, It just logs in with a Success Message saying - Login Successful. – Dtorr1981 Jan 17 '18 at 17:56
  • Create a Login page hidden menu item and check the redirect variables for that page. You should be able to set things that way. – Terry Carter Jan 17 '18 at 20:48
0

in you login url you need to do something like this :

$app = JFactory::getApplication();
$message = "You must be logged in to view this content";
$url = JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode('YOUR COMPONENT VIEW URL HERE')
$app->redirect($url, $message);
  • Hi, thank you. Could you explain a bit more please? I'm not sure what you mean? – Dtorr1981 Jan 17 '18 at 17:57
  • I've dismissed the flag on this for now, so please explain in a little more detail. – Lodder Jan 24 '18 at 11:27
0

SO I've figured this was caused by a conflict between JomSocial/Mosets Tree and the Joomla core.

The following plugin rectified the issue: Redirect on logon

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.