简体   繁体   English

从登录模块获取网址以在Joomla上重定向

[英]obtain url from login module for redirect on Joomla

Using Joomla 2.5 and trying to do some redirects based on the login module where you can click Forgot your password or Forgot your username . 使用Joomla 2.5并尝试基于登录模块进行一些重定向,您可以在其中单击“ Forgot your password或“ Forgot your username

I thought this should work for username: 我认为这应该适用于用户名:

if((JRequest::getString('option')=='com_users') && (JRequest::getString('view')=='remind'))

and this for password: 这是密码:

if((JRequest::getString('option')=='com_users') && (JRequest::getString('view')=='reset'))

I never seem to get into this if statement. 我似乎从来没有进入过这个if语句。 What am I doing wrong? 我究竟做错了什么?

Try this, 尝试这个,

if((JRequest::getVar('option')=='com_users') && (JRequest::getVar('view')=='remind'))

If this also failed you can try with, 如果还是失败,可以尝试一下,

$_REQUEST['option'] it will definitely works but its not a good practice for joomla sites. $_REQUEST['option']肯定可以,但是对于joomla网站不是一个好习惯。

I found the only thing that worked for me is to use: 我发现唯一对我有用的是使用:

if((JRequest::getVar('option')!='com_users')

This covers both cases of remind and reset . 这涵盖了remindreset两种情况。 Not sure if there are other edge cases where this won't match. 不知道是否还有其他不匹配的情况。

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

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