Joomla Login redirection back to page to the previous page

后端 未结 3 1192
孤街浪徒
孤街浪徒 2021-01-13 15:05

I have certain pages that require to a user to be logged in Joomla. When they click on the links to those pages a login box appears in an iframe overlay. Once they login, I

相关标签:
3条回答
  • 2021-01-13 15:37

    You can use like

    $return = JURI::getInstance()->toString();
    $url    = 'index.php?option=com_user&view=login';
    $url   .= '&return='.base64_encode($return);
    $this->setRedirect($url, XiText::_('YOU_MUST_LOGIN_FIRST'));  // if you are in controller
    
    or 
    
    JFactory::getApplication()->redirect($url, XiText::_('YOU_MUST_LOGIN_FIRST'));  
    
    0 讨论(0)
  • 2021-01-13 15:45

    I used $this->setRedirect($link, $msg);

    For more information on this function refer here http://docs.joomla.org/API15:JController/setRedirect

    0 讨论(0)
  • 2021-01-13 15:51

    [SOLVED] I have solved this issue and implemented in the site. Follow this link, I have written a 5 step tutorial on how to do this.(No Code editing required).

    This is how you can do it.

    In Hidden Menu

    1.Add New menu item : Call it eg. "Login Hidden Menu" . (Users won't see this menu).

    2.Add a new menu item name it eg. "User Article upload "to Login hidden menu, Choose Menu Item type : "Create article".(or any other component which only registered users can access. But public can view, Give Access as "Registered" for this Menu.)

    In Main menu

    1.Goto your Main Menu and create a menu item call it "Submit Article to website".

    2.Choose Menu Item type : Menu Item Alias and choose "User Article upload " (you created in Login hidden menu), give access as public.

    ALL DONE. Now when visitor clicks on "Submit Article to website" they will be redirected to login page instead of 403 error.

    0 讨论(0)
提交回复
热议问题