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;
}