(syslog). Although intended to be useful, it's more of a testbed for event hooks than anything else. For a first pass, started logging user login and user logout events. Had to add hooks-running code to the login and logout modules, but that's kind of the point. Documented the three events added in hooks.doc.
27 lines
433 B
PHP
27 lines
433 B
PHP
<?php
|
|
/**
|
|
*
|
|
* @package MediaWiki
|
|
* @subpackage SpecialPage
|
|
*/
|
|
|
|
/**
|
|
* constructor
|
|
*/
|
|
function wfSpecialUserlogout() {
|
|
global $wgUser, $wgOut, $returnto;
|
|
|
|
if (wfRunHooks('UserLogout', $wgUser)) {
|
|
|
|
$wgUser->logout();
|
|
|
|
$wgOut->mCookies = array();
|
|
$wgOut->setRobotpolicy( 'noindex,nofollow' );
|
|
$wgOut->addHTML( wfMsg( 'logouttext' ) );
|
|
$wgOut->returnToMain();
|
|
|
|
wfRunHooks('UserLogoutComplete', $wgUser);
|
|
}
|
|
}
|
|
|
|
?>
|