简体   繁体   English

获取PHP注意:未定义索引:使用joomla以外的插件然后在joomla登录时在joomla中使用password_clear

[英]Getting PHP Notice: Undefined index: password_clear in joomla when using plugin other then joomla login

I am getting PHP Notice: Undefined index: password_clear when I use any plugin other then joomla's login plugin to log-in the user. 我正在获取PHP注意:当我使用除joomla的登录插件以外的任何插件登录用户时,未定义索引:password_clear。 In joomla database, we are not storing any user's data. 在joomla数据库中,我们不存储任何用户数据。 so I have got a custom plugin, which will do the check for user's credentials through a web service call. 所以我有一个自定义插件,它将通过网络服务调用检查用户的凭据。

The credentials are checked good, and joomla does show the user has logged in, and rest of the things are also working fine. 凭据被检查为良好,并且joomla确实表明用户已登录,其余的一切也正常运行。 But my logs are filled with the above Notices! 但是我的日志中充满了以上注意事项!

Any one faced such problem or any hints or directions for me? 有人遇到这样的问题或对我有任何提示或指示吗?

Thanks for help in advance, Tanmay 提前感谢您,坦美

You can do two things: 您可以做两件事:

  1. Edit php.ini and set error_reporting to E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR 编辑php.ini并将error_reporting设置为E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
  2. Edit the plugin code and test the presence of password_clear before using it. 编辑插件代码,并在使用前测试password_clear的存在。

Here's an example how to do the testing part: 这是一个如何进行测试的示例:

$clear = $_POST['password_clear']; /* old */
$clear = empty($_POST['password_clear']) ? '' : $_POST['password_clear']; /* fixed */

or: 要么:

if ($_POST['password_clear'] == 'x') {...} /* old */
if (! empty($_POST['password_clear']) && $_POST['password_clear'] == 'x') {...} /* fixed */

@JMZ, your reply did gave me some ideas of looking into the stuff, and I got the solution. @JMZ,您的回复确实给了我一些调查的想法,我找到了解决方案。 I am not user, if the changes I did are valid, but it works for me. 如果我所做的更改是有效的,则我不是用户,但是它对我有用。 I basically grabbed the gmail.php login plugin as the base for creating my own plugin. 我基本上抓住了gmail.php登录插件作为创建自己的插件的基础。

Now on the success I had to add $response->password_clear = ""; 现在成功了,我必须添加$ response-> password_clear =“”; to the response object, so that at least it has a reference and will not give me a notice of undefined index. 到响应对象,因此至少它具有引用,并且不会给我未定义索引的通知。

Hope some one will be helped. 希望有人会有所帮助。 Or if some one has a better understanding on this, please do let me know. 或者,如果有人对此有更好的了解,请告诉我。

Thanks, Tanmay 谢谢,坦美

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

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