简体   繁体   English

我们有joomla网站,当会话无效时,特定的URL会进入登录页面,并且在成功登录后不会重定向

[英]We have joomla site, a specific URL goes to login page when session is not active and does not get redirect after successful login

We have Joomla bases site - a given url to particular page works fine when user is logged in. 我们有Joomla基本站点-特定页面的给定URL在用户登录时可以正常运行。

If user is not logged in, the url redirects to login page and stays there. 如果用户未登录,则URL重定向到登录页面并停留在该页面。

How to redirect the browser to load the intended page after login?? 登录后如何重定向浏览器以加载预期的页面?

At the place where you create the url to do the redirect append the return parameter to it. 在创建要进行重定向的URL的位置,将return参数附加到该URL。 Something along the lines should work: 大致思路应该可以:

$return = base64_encode(JURI::getInstance(
              JFactory::getURI()->toString(array('path', 'query', 'fragment'))
          ));
JFactory::getApplication()->redirect(
    JRoute::_('index.php?option=com_users&view=login&return=' . $return, true, true)
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM