00001 <?php
00010 function wfSpecialUserlogout() {
00011 global $wgUser, $wgOut;
00012
00017 if ( isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], '&' ) !== false ) {
00018 wfDebug( "Special:Userlogout request {$_SERVER['REQUEST_URI']} looks suspicious, denying.\n" );
00019 wfHttpError( 400, wfMsg( 'loginerror' ), wfMsg( 'suspicious-userlogout' ) );
00020 return;
00021 }
00022
00023 $oldName = $wgUser->getName();
00024 $wgUser->logout();
00025 $wgOut->setRobotPolicy( 'noindex,nofollow' );
00026
00027
00028 $injected_html = '';
00029 wfRunHooks( 'UserLogoutComplete', array(&$wgUser, &$injected_html, $oldName) );
00030
00031 $wgOut->addHTML( wfMsgExt( 'logouttext', array( 'parse' ) ) . $injected_html );
00032 $wgOut->returnToMain();
00033 }