Joomla 登录重定向回页面到上一页 [英] Joomla Login redirection back to page to the previous page

查看:18
本文介绍了Joomla 登录重定向回页面到上一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有某些页面需要用户登录 Joomla.当他们点击这些页面的链接时,一个登录框会出现在 iframe 叠加层中.一旦他们登录,我想将他们重定向回他们试图登录的页面,但是,Joomla 似乎只允许用户重定向到登录表单参数中预定义的页面.有没有办法在不完全入侵 Joomla 的情况下做到这一点.

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 want to redirect them back to the page they were trying to login to, however, Joomla seems to only allow a user to be redirected to a page that is predefined in the login form parameters. Is there a way to do this without completely hacking Joomla.

如果没有,有没有人有关于如何以简单的方式破解这个的建议.

If not, does anyone have a recommendation on how to hack this an easy way.

推荐答案

你可以用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'));  

这篇关于Joomla 登录重定向回页面到上一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆