1
我已经成功实现了onUserAuthenticate
事件来实现我的自定义身份验证API在Joomla!我正在努力的网站。Joomla! 3.xx * onUserLogout *事件不起作用
现在我想要在onUserLogout
事件上运行一些自定义代码。
我已将以下代码添加到自定义身份验证插件文件。 但是这种方法没有被触发/调用,而前一个(onUserAuthenticate
)工作得很好。
/**
* Method to handle the SSO logout
*
* @param array $user Holds the user data.
* @param array $options Array holding options (client, ...).
*
* @return boolean Always returns true.
*
* @since 1.6
*/
public function onUserLogout($user, $options = array()) {
if (JFactory::getApplication()->isSite()) {
// Set the cookie to expired date.
setcookie('customAuth', '123', time() - (60 * 60 * 24 * 365), '/', '.customdomain.org');
}
return true;
}