我制作了一个插件,可以对我们的XML服务器进行身份验证,就像魅力一样。但是现在我正在尝试为onUserAfterSave函数制作插件,这样我就可以进行登录后处理,例如将用户分配到其中一个。
但是ik无法获得基本的帮助。
xml文件中的引爆定义如下所示:
<extension version="3.1" type="plugin" group="user">
和这样的PHP文件
// No direct access
defined('_JEXEC') or die;
//include_once "functions.php";
/**
* HCC XML-RPC login handler plugin
*
* @package Joomla.Plugin
* @subpackage User.hcc_xml_handler
* @since 3.1
*/
class PlgUserhcc_xml_handler extends JPlugin
{
/**
* This plug process the extra login information.
*
*
* @param array $user Holds the new user data.
* @param boolean $isnew True if a new user is stored.
* @param boolean $success True if user was succesfully stored in the database.
* @param string $msg Message.
*
* @return void
*
* @since 1.6
*/
public function onUserAfterSave($user, $isnew, $success, $msg)
{
/*
$debug = $this->params->get('debug', '0');
if ($debug == '1')
{$debugfile = $this->params->get('debugfile', '');}
else{$debugfile = "";}
$debug = $this->params->get('debug', '0');
*/
$debug = '1';
$debugfile = "/disk/site/hcc.nl/poc-groepen/logging/hcc_xml_handler-debug.log";
if ($debug == '1')
{
// set debug log file if debug is enabled
$debugstartmsg = "=====================================\n";
$debugstartmsg .= "= start hcc_xml_handler.php aanroep =\n";
$debugstartmsg .= "=====================================\n";
file_put_contents($debugfile, $debugstartmsg, FILE_APPEND | LOCK_EX);
}
if (!$success)
{
if ($debug == '1')
{
$debugsuccessmsg = "login gelukt" ;
file_put_contents($debugfile, $debugsuccessmsg, FILE_APPEND | LOCK_EX);
}
return false;
}
if ($isnew)
{
if ($debug == '1')
{
$debugnewsmsg = "login NEW" ;
file_put_contents($debugfile, $debugnewsmsg, FILE_APPEND | LOCK_EX);
}
return false;
}
if ($debug == '1')
{
// set debug log file if debug is enabled
$debugstopmsg = "=====================================\n";
$debugstopmsg .= "= stop hcc_xml_handler.php aanroep =\n";
$debugstopmsg .= "=====================================\n";
file_put_contents($debugfile, $debugstopmsg, FILE_APPEND | LOCK_EX);
}
}
}
我究竟做错了什么 ?
我在记录中看到的错误是:
mysqli_fetch_row()期望参数1为mysqli_result,在第785行的/www/libraries/joomla/database/driver/mysqli.php中给出的布尔值,引用:https: //someurl.hcc.nl/ mysqli_free_result()期望参数1为是mysqli_result,在第828行的/www/libraries/joomla/database/driver/mysqli.php中给出的布尔值,引荐网址:https ://someurl.hcc.nl/
任何一个想法?
我切换到对我有用的onUserAfterLogin函数
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句