MediaWiki  1.23.2
SpecialUserlogout.php
Go to the documentation of this file.
1 <?php
30  function __construct() {
31  parent::__construct( 'Userlogout' );
32  }
33 
34  function execute( $par ) {
39  if ( isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], '&amp;' ) !== false ) {
40  wfDebug( "Special:Userlogout request {$_SERVER['REQUEST_URI']} looks suspicious, denying.\n" );
41  throw new HttpError( 400, $this->msg( 'suspicious-userlogout' ), $this->msg( 'loginerror' ) );
42  }
43 
44  $this->setHeaders();
45  $this->outputHeader();
46 
47  $user = $this->getUser();
48  $oldName = $user->getName();
49  $user->logout();
50 
51  $loginURL = SpecialPage::getTitleFor( 'Userlogin' )->getFullURL(
52  $this->getRequest()->getValues( 'returnto', 'returntoquery' ) );
53 
54  $out = $this->getOutput();
55  $out->addWikiMsg( 'logouttext', $loginURL );
56 
57  // Hook.
58  $injected_html = '';
59  wfRunHooks( 'UserLogoutComplete', array( &$user, &$injected_html, $oldName ) );
60  $out->addHTML( $injected_html );
61 
62  $out->returnToMain();
63  }
64 
65  protected function getGroupName() {
66  return 'login';
67  }
68 }
SpecialUserlogout
Implements Special:Userlogout.
Definition: SpecialUserlogout.php:29
SpecialUserlogout\__construct
__construct()
Definition: SpecialUserlogout.php:30
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:535
UnlistedSpecialPage
Shortcut to construct a special page which is unlisted by default.
Definition: UnlistedSpecialPage.php:29
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
Definition: SpecialPage.php:74
HttpError
Show an error that looks like an HTTP server error.
Definition: HttpError.php:28
$out
$out
Definition: UtfNormalGenerate.php:167
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4001
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:352
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:545
SpecialUserlogout\execute
execute( $par)
Default execute method Checks user permissions, calls the function given in mFunction.
Definition: SpecialUserlogout.php:34
wfDebug
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:933
SpecialPage\msg
msg()
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:609
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:525
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:443
SpecialUserlogout\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialUserlogout.php:65