3 * SpecialPage: handling special pages and lists thereof.
5 * To add a special page in an extension, add to $wgSpecialPages either
6 * an object instance or an array containing the name and constructor
7 * parameters. The latter is preferred for performance reasons.
9 * The object instantiated must be either an instance of SpecialPage or a
10 * sub-class thereof. It must have an execute() method, which sends the HTML
11 * for the special page to $wgOut. The parent class has an execute() method
12 * which distributes the call to the historical global functions. Additionally,
13 * execute() also checks if the user has the necessary access privileges
14 * and bails out if not.
16 * To add a core special page, use the similar static list in
17 * SpecialPage::$mList. To remove a core static special page at runtime, use
18 * a SpecialPage_initList hook.
20 * @addtogroup SpecialPage
28 * Parent special page class, also static functions for handling the special
30 * @addtogroup SpecialPage
38 * The canonical name of this special page
39 * Also used for the default <h1> heading, @see getDescription()
43 * The local name of this special page
47 * Minimum user level required to access this page, or "" for anyone.
48 * Also used to categorise the pages in Special:Specialpages
52 * Listed in Special:Specialpages?
56 * Function name called by the default execute()
60 * File which needs to be included before the function above can be called
64 * Whether or not this special page is being included from an article
68 * Whether the special page can be included in an article
72 * Query parameters that can be passed through redirects
74 var $mAllowedRedirectParams = array();
76 static public $mList = array(
77 'DoubleRedirects' => array( 'SpecialPage', 'DoubleRedirects' ),
78 'BrokenRedirects' => array( 'SpecialPage', 'BrokenRedirects' ),
79 'Disambiguations' => array( 'SpecialPage', 'Disambiguations' ),
81 'Userlogin' => array( 'SpecialPage', 'Userlogin' ),
82 'Userlogout' => array( 'UnlistedSpecialPage', 'Userlogout' ),
83 'Preferences' => array( 'SpecialPage', 'Preferences' ),
84 'Watchlist' => array( 'SpecialPage', 'Watchlist' ),
86 'Recentchanges' => array( 'IncludableSpecialPage', 'Recentchanges' ),
87 'Upload' => array( 'SpecialPage', 'Upload' ),
88 'Imagelist' => array( 'SpecialPage', 'Imagelist' ),
89 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ),
90 'Listusers' => array( 'SpecialPage', 'Listusers' ),
91 'Statistics' => array( 'SpecialPage', 'Statistics' ),
92 'Randompage' => array( 'SpecialPage', 'Randompage' ),
93 'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ),
94 'Uncategorizedpages' => array( 'SpecialPage', 'Uncategorizedpages' ),
95 'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ),
96 'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ),
97 'Uncategorizedtemplates' => array( 'SpecialPage', 'Uncategorizedtemplates' ),
98 'Unusedcategories' => array( 'SpecialPage', 'Unusedcategories' ),
99 'Unusedimages' => array( 'SpecialPage', 'Unusedimages' ),
100 'Wantedpages' => array( 'IncludableSpecialPage', 'Wantedpages' ),
101 'Wantedcategories' => array( 'SpecialPage', 'Wantedcategories' ),
102 'Mostlinked' => array( 'SpecialPage', 'Mostlinked' ),
103 'Mostlinkedcategories' => array( 'SpecialPage', 'Mostlinkedcategories' ),
104 'Mostlinkedtemplates' => array( 'SpecialPage', 'Mostlinkedtemplates' ),
105 'Mostcategories' => array( 'SpecialPage', 'Mostcategories' ),
106 'Mostimages' => array( 'SpecialPage', 'Mostimages' ),
107 'Mostrevisions' => array( 'SpecialPage', 'Mostrevisions' ),
108 'Fewestrevisions' => array( 'SpecialPage', 'Fewestrevisions' ),
109 'Shortpages' => array( 'SpecialPage', 'Shortpages' ),
110 'Longpages' => array( 'SpecialPage', 'Longpages' ),
111 'Newpages' => array( 'IncludableSpecialPage', 'Newpages' ),
112 'Ancientpages' => array( 'SpecialPage', 'Ancientpages' ),
113 'Deadendpages' => array( 'SpecialPage', 'Deadendpages' ),
114 'Protectedpages' => array( 'SpecialPage', 'Protectedpages' ),
115 'Allpages' => array( 'IncludableSpecialPage', 'Allpages' ),
116 'Prefixindex' => array( 'IncludableSpecialPage', 'Prefixindex' ) ,
117 'Ipblocklist' => array( 'SpecialPage', 'Ipblocklist' ),
118 'Specialpages' => array( 'UnlistedSpecialPage', 'Specialpages' ),
119 'Contributions' => array( 'SpecialPage', 'Contributions' ),
120 'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ),
121 'Whatlinkshere' => array( 'SpecialPage', 'Whatlinkshere' ),
122 'Recentchangeslinked' => array( 'UnlistedSpecialPage', 'Recentchangeslinked' ),
123 'Movepage' => array( 'UnlistedSpecialPage', 'Movepage' ),
124 'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ),
125 'Resetpass' => array( 'UnlistedSpecialPage', 'Resetpass' ),
126 'Booksources' => 'SpecialBookSources',
127 'Categories' => array( 'SpecialPage', 'Categories' ),
128 'Export' => array( 'SpecialPage', 'Export' ),
129 'Version' => array( 'SpecialPage', 'Version' ),
130 'Allmessages' => array( 'SpecialPage', 'Allmessages' ),
131 'Log' => array( 'SpecialPage', 'Log' ),
132 'Blockip' => array( 'SpecialPage', 'Blockip', 'block' ),
133 'Undelete' => array( 'SpecialPage', 'Undelete', 'deletedhistory' ),
134 'Import' => array( 'SpecialPage', "Import", 'import' ),
135 'Lockdb' => array( 'SpecialPage', 'Lockdb', 'siteadmin' ),
136 'Unlockdb' => array( 'SpecialPage', 'Unlockdb', 'siteadmin' ),
137 'Userrights' => array( 'SpecialPage', 'Userrights', 'userrights' ),
138 'MIMEsearch' => array( 'SpecialPage', 'MIMEsearch' ),
139 'Unwatchedpages' => array( 'SpecialPage', 'Unwatchedpages', 'unwatchedpages' ),
140 'Listredirects' => array( 'SpecialPage', 'Listredirects' ),
141 'Revisiondelete' => array( 'SpecialPage', 'Revisiondelete', 'deleterevision' ),
142 'Unusedtemplates' => array( 'SpecialPage', 'Unusedtemplates' ),
143 'Randomredirect' => array( 'SpecialPage', 'Randomredirect' ),
144 'Withoutinterwiki' => array( 'SpecialPage', 'Withoutinterwiki' ),
146 'Mypage' => array( 'SpecialMypage' ),
147 'Mytalk' => array( 'SpecialMytalk' ),
148 'Mycontributions' => array( 'SpecialMycontributions' ),
149 'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ),
150 'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
153 static public $mAliases;
154 static public $mListInitialised = false;
159 * Initialise the special page list
160 * This must be called before accessing SpecialPage::$mList
162 static function initList() {
163 global $wgSpecialPages;
164 global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
166 if ( self
::$mListInitialised ) {
169 wfProfileIn( __METHOD__
);
171 # Better to set this now, to avoid infinite recursion in carelessly written hooks
172 self
::$mListInitialised = true;
174 if( !$wgDisableCounters ) {
175 self
::$mList['Popularpages'] = array( 'SpecialPage', 'Popularpages' );
178 if( !$wgDisableInternalSearch ) {
179 self
::$mList['Search'] = array( 'SpecialPage', 'Search' );
182 if( $wgEmailAuthentication ) {
183 self
::$mList['Confirmemail'] = 'EmailConfirmation';
186 # Add extension special pages
187 self
::$mList = array_merge( self
::$mList, $wgSpecialPages );
190 # This hook can be used to remove undesired built-in special pages
191 wfRunHooks( 'SpecialPage_initList', array( &self
::$mList ) );
192 wfProfileOut( __METHOD__
);
195 static function initAliasList() {
196 if ( !is_null( self
::$mAliases ) ) {
201 $aliases = $wgContLang->getSpecialPageAliases();
202 $missingPages = self
::$mList;
203 self
::$mAliases = array();
204 foreach ( $aliases as $realName => $aliasList ) {
205 foreach ( $aliasList as $alias ) {
206 self
::$mAliases[$wgContLang->caseFold( $alias )] = $realName;
208 unset( $missingPages[$realName] );
210 foreach ( $missingPages as $name => $stuff ) {
211 self
::$mAliases[$wgContLang->caseFold( $name )] = $name;
216 * Given a special page alias, return the special page name.
217 * Returns false if there is no such alias.
219 static function resolveAlias( $alias ) {
222 if ( !self
::$mListInitialised ) self
::initList();
223 if ( is_null( self
::$mAliases ) ) self
::initAliasList();
224 $caseFoldedAlias = $wgContLang->caseFold( $alias );
225 if ( isset( self
::$mAliases[$caseFoldedAlias] ) ) {
226 return self
::$mAliases[$caseFoldedAlias];
233 * Given a special page name with a possible subpage, return an array
234 * where the first element is the special page name and the second is the
237 static function resolveAliasWithSubpage( $alias ) {
238 $bits = explode( '/', $alias, 2 );
239 $name = self
::resolveAlias( $bits[0] );
240 if( !isset( $bits[1] ) ) { // bug 2087
245 return array( $name, $par );
249 * Add a page to the list of valid special pages. This used to be the preferred
250 * method for adding special pages in extensions. It's now suggested that you add
251 * an associative record to $wgSpecialPages. This avoids autoloading SpecialPage.
253 * @param mixed $page Must either be an array specifying a class name and
254 * constructor parameters, or an object. The object,
255 * when constructed, must have an execute() method which
256 * sends HTML to $wgOut.
259 static function addPage( &$page ) {
260 if ( !self
::$mListInitialised ) {
263 self
::$mList[$page->mName
] = $page;
267 * Remove a special page from the list
268 * Formerly used to disable expensive or dangerous special pages. The
269 * preferred method is now to add a SpecialPage_initList hook.
273 static function removePage( $name ) {
274 if ( !self
::$mListInitialised ) {
277 unset( self
::$mList[$name] );
281 * Check if a given name exist as a special page or as a special page alias
282 * @param $name string: name of a special page
283 * @return boolean: true if a special page exists with this name
285 static function exists( $name ) {
287 if ( !self
::$mListInitialised ) {
290 if( !self
::$mAliases ) {
291 self
::initAliasList();
294 # Remove special pages inline parameters:
295 $bits = explode( '/', $name );
296 $name = $wgContLang->caseFold($bits[0]);
299 array_key_exists( $name, self
::$mList )
300 or array_key_exists( $name, self
::$mAliases )
305 * Find the object with a given name and return it (or NULL)
307 * @param string $name
309 static function getPage( $name ) {
310 if ( !self
::$mListInitialised ) {
313 if ( array_key_exists( $name, self
::$mList ) ) {
314 $rec = self
::$mList[$name];
315 if ( is_string( $rec ) ) {
317 self
::$mList[$name] = new $className;
318 } elseif ( is_array( $rec ) ) {
319 $className = array_shift( $rec );
320 self
::$mList[$name] = wfCreateObject( $className, $rec );
322 return self
::$mList[$name];
329 * Get a special page with a given localised name, or NULL if there
330 * is no such special page.
332 static function getPageByAlias( $alias ) {
333 $realName = self
::resolveAlias( $alias );
335 return self
::getPage( $realName );
342 * Return categorised listable special pages for all users
345 static function getRegularPages() {
346 if ( !self
::$mListInitialised ) {
351 foreach ( self
::$mList as $name => $rec ) {
352 $page = self
::getPage( $name );
353 if ( $page->isListed() && $page->getRestriction() == '' ) {
354 $pages[$name] = $page;
361 * Return categorised listable special pages which are available
362 * for the current user, but not for everyone
365 static function getRestrictedPages() {
367 if ( !self
::$mListInitialised ) {
372 foreach ( self
::$mList as $name => $rec ) {
373 $page = self
::getPage( $name );
374 if ( $page->isListed() ) {
375 $restriction = $page->getRestriction();
376 if ( $restriction != '' && $wgUser->isAllowed( $restriction ) ) {
377 $pages[$name] = $page;
385 * Execute a special page path.
386 * The path may contain parameters, e.g. Special:Name/Params
387 * Extracts the special page name and call the execute method, passing the parameters
389 * Returns a title object if the page is redirected, false if there was no such special
390 * page, and true if it was successful.
392 * @param $title a title object
393 * @param $including output is being captured for use in {{special:whatever}}
395 static function executePath( &$title, $including = false ) {
396 global $wgOut, $wgTitle, $wgRequest;
397 wfProfileIn( __METHOD__
);
399 # FIXME: redirects broken due to this call
400 $bits = explode( '/', $title->getDBkey(), 2 );
402 if( !isset( $bits[1] ) ) { // bug 2087
407 $page = SpecialPage
::getPageByAlias( $name );
412 $wgOut->setArticleRelated( false );
413 $wgOut->setRobotpolicy( 'noindex,nofollow' );
414 $wgOut->setStatusCode( 404 );
415 $wgOut->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
417 wfProfileOut( __METHOD__
);
423 $redirect = $page->getRedirect( $par );
425 $query = $page->getRedirectQuery();
426 $url = $redirect->getFullUrl( $query );
427 $wgOut->redirect( $url );
428 wfProfileOut( __METHOD__
);
433 # Redirect to canonical alias for GET commands
434 # Not for POST, we'd lose the post data, so it's best to just distribute
435 # the request. Such POST requests are possible for old extensions that
436 # generate self-links without being aware that their default name has
438 if ( !$including && $name != $page->getLocalName() && !$wgRequest->wasPosted() ) {
440 unset( $query['title'] );
441 $query = wfArrayToCGI( $query );
442 $title = $page->getTitle( $par );
443 $url = $title->getFullUrl( $query );
444 $wgOut->redirect( $url );
445 wfProfileOut( __METHOD__
);
449 if ( $including && !$page->includable() ) {
450 wfProfileOut( __METHOD__
);
452 } elseif ( !$including ) {
453 $wgTitle = $page->getTitle();
455 $page->including( $including );
457 // Execute special page
458 $profName = 'Special:' . $page->getName();
459 wfProfileIn( $profName );
460 $page->execute( $par );
461 wfProfileOut( $profName );
462 wfProfileOut( __METHOD__
);
467 * Just like executePath() except it returns the HTML instead of outputting it
468 * Returns false if there was no such special page, or a title object if it was
472 static function capturePath( &$title ) {
473 global $wgOut, $wgTitle;
475 $oldTitle = $wgTitle;
477 $wgOut = new OutputPage
;
479 $ret = SpecialPage
::executePath( $title, true );
480 if ( $ret === true ) {
481 $ret = $wgOut->getHTML();
483 $wgTitle = $oldTitle;
489 * Get the local name for a specified canonical name
491 static function getLocalNameFor( $name, $subpage = false ) {
493 $aliases = $wgContLang->getSpecialPageAliases();
494 if ( isset( $aliases[$name][0] ) ) {
495 $name = $aliases[$name][0];
497 if ( $subpage !== false && !is_null( $subpage ) ) {
498 $name = "$name/$subpage";
504 * Get a localised Title object for a specified special page name
506 static function getTitleFor( $name, $subpage = false ) {
507 $name = self
::getLocalNameFor( $name, $subpage );
509 return Title
::makeTitle( NS_SPECIAL
, $name );
511 throw new MWException( "Invalid special page name \"$name\"" );
516 * Get a localised Title object for a page name with a possibly unvalidated subpage
518 static function getSafeTitleFor( $name, $subpage = false ) {
519 $name = self
::getLocalNameFor( $name, $subpage );
521 return Title
::makeTitleSafe( NS_SPECIAL
, $name );
528 * Get a title for a given alias
529 * @return Title or null if there is no such alias
531 static function getTitleForAlias( $alias ) {
532 $name = self
::resolveAlias( $alias );
534 return self
::getTitleFor( $name );
541 * Default constructor for special pages
542 * Derivative classes should call this from their constructor
543 * Note that if the user does not have the required level, an error message will
544 * be displayed by the default execute() method, without the global function ever
547 * If you override execute(), you can recover the default behaviour with userCanExecute()
548 * and displayRestrictionError()
550 * @param string $name Name of the special page, as seen in links and URLs
551 * @param string $restriction User right required, e.g. "block" or "delete"
552 * @param boolean $listed Whether the page is listed in Special:Specialpages
553 * @param string $function Function called by execute(). By default it is constructed from $name
554 * @param string $file File which is included by execute(). It is also constructed from $name by default
556 function SpecialPage( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) {
557 $this->mName
= $name;
558 $this->mRestriction
= $restriction;
559 $this->mListed
= $listed;
560 $this->mIncludable
= $includable;
561 if ( $function == false ) {
562 $this->mFunction
= 'wfSpecial'.$name;
564 $this->mFunction
= $function;
566 if ( $file === 'default' ) {
567 $this->mFile
= dirname(__FILE__
) . "/Special{$name}.php";
569 $this->mFile
= $file;
578 function getName() { return $this->mName
; }
579 function getRestriction() { return $this->mRestriction
; }
580 function getFile() { return $this->mFile
; }
581 function isListed() { return $this->mListed
; }
585 * Accessor and mutator
587 function name( $x = NULL ) { return wfSetVar( $this->mName
, $x ); }
588 function restrictions( $x = NULL) { return wfSetVar( $this->mRestrictions
, $x ); }
589 function listed( $x = NULL) { return wfSetVar( $this->mListed
, $x ); }
590 function func( $x = NULL) { return wfSetVar( $this->mFunction
, $x ); }
591 function file( $x = NULL) { return wfSetVar( $this->mFile
, $x ); }
592 function includable( $x = NULL ) { return wfSetVar( $this->mIncludable
, $x ); }
593 function including( $x = NULL ) { return wfSetVar( $this->mIncluding
, $x ); }
597 * Get the localised name of the special page
599 function getLocalName() {
600 if ( !isset( $this->mLocalName
) ) {
601 $this->mLocalName
= self
::getLocalNameFor( $this->mName
);
603 return $this->mLocalName
;
607 * Checks if the given user (identified by an object) can execute this
608 * special page (as defined by $mRestriction)
610 function userCanExecute( &$user ) {
611 return $user->isAllowed( $this->mRestriction
);
615 * Output an error message telling the user what access level they have to have
617 function displayRestrictionError() {
619 $wgOut->permissionRequired( $this->mRestriction
);
623 * Sets headers - this should be called from the execute() method of all derived classes!
625 function setHeaders() {
627 $wgOut->setArticleRelated( false );
628 $wgOut->setRobotPolicy( "noindex,nofollow" );
629 $wgOut->setPageTitle( $this->getDescription() );
633 * Default execute method
634 * Checks user permissions, calls the function given in mFunction
636 * This may be overridden by subclasses.
638 function execute( $par ) {
643 if ( $this->userCanExecute( $wgUser ) ) {
644 $func = $this->mFunction
;
645 // only load file if the function does not exist
646 if(!is_callable($func) and $this->mFile
) {
647 require_once( $this->mFile
);
649 # FIXME: these hooks are broken for extensions and anything else that subclasses SpecialPage.
650 if ( wfRunHooks( 'SpecialPageExecuteBeforeHeader', array( &$this, &$par, &$func ) ) )
651 $this->outputHeader();
652 if ( ! wfRunHooks( 'SpecialPageExecuteBeforePage', array( &$this, &$par, &$func ) ) )
654 call_user_func( $func, $par, $this );
655 if ( ! wfRunHooks( 'SpecialPageExecuteAfterPage', array( &$this, &$par, &$func ) ) )
658 $this->displayRestrictionError();
662 function outputHeader() {
663 global $wgOut, $wgContLang;
665 $msg = $wgContLang->lc( $this->name() ) . '-summary';
666 $out = wfMsg( $msg );
667 if ( ! wfEmptyMsg( $msg, $out ) and $out !== '' and ! $this->including() )
668 $wgOut->addWikiText( $out );
672 # Returns the name that goes in the <h1> in the special page itself, and also the name that
673 # will be listed in Special:Specialpages
675 # Derived classes can override this, but usually it is easier to keep the default behaviour.
676 # Messages can be added at run-time, see MessageCache.php
677 function getDescription() {
678 return wfMsg( strtolower( $this->mName
) );
682 * Get a self-referential title object
684 function getTitle( $subpage = false) {
685 return self
::getTitleFor( $this->mName
, $subpage );
689 * Set whether this page is listed in Special:Specialpages, at run-time
691 function setListed( $listed ) {
692 return wfSetVar( $this->mListed
, $listed );
696 * If the special page is a redirect, then get the Title object it redirects to.
699 function getRedirect( $subpage ) {
704 * Return part of the request string for a special redirect page
705 * This allows passing, e.g. action=history to Special:Mypage, etc.
709 function getRedirectQuery() {
712 foreach( $this->mAllowedRedirectParams
as $arg ) {
713 if( $val = $wgRequest->getVal( $arg, false ) )
714 $params[] = $arg . '=' . $val;
717 return count( $params ) ?
implode( '&', $params ) : false;
722 * Shortcut to construct a special page which is unlisted by default
723 * @addtogroup SpecialPage
725 class UnlistedSpecialPage
extends SpecialPage
727 function UnlistedSpecialPage( $name, $restriction = '', $function = false, $file = 'default' ) {
728 SpecialPage
::SpecialPage( $name, $restriction, false, $function, $file );
733 * Shortcut to construct an includable special page
734 * @addtogroup SpecialPage
736 class IncludableSpecialPage
extends SpecialPage
738 function IncludableSpecialPage( $name, $restriction = '', $listed = true, $function = false, $file = 'default' ) {
739 SpecialPage
::SpecialPage( $name, $restriction, $listed, $function, $file, true );
744 * Shortcut to construct a special page alias.
745 * @addtogroup SpecialPage
747 class SpecialRedirectToSpecial
extends UnlistedSpecialPage
{
748 var $redirName, $redirSubpage;
750 function __construct( $name, $redirName, $redirSubpage = false, $redirectParams = array() ) {
751 parent
::__construct( $name );
752 $this->redirName
= $redirName;
753 $this->redirSubpage
= $redirSubpage;
754 $this->mAllowedRedirectParams
= $redirectParams;
757 function getRedirect( $subpage ) {
758 if ( $this->redirSubpage
=== false ) {
759 return SpecialPage
::getTitleFor( $this->redirName
, $subpage );
761 return SpecialPage
::getTitleFor( $this->redirName
, $this->redirSubpage
);
766 /** SpecialMypage, SpecialMytalk and SpecialMycontributions special pages
767 * are used to get user independant links pointing to the user page, talk
768 * page and list of contributions.
769 * This can let us cache a single copy of any generated content for all
774 * Shortcut to construct a special page pointing to current user user's page.
775 * @addtogroup SpecialPage
777 class SpecialMypage
extends UnlistedSpecialPage
{
778 function __construct() {
779 parent
::__construct( 'Mypage' );
780 $this->mAllowedRedirectParams
= array( 'action' , 'preload' , 'editintro' );
783 function getRedirect( $subpage ) {
785 if ( strval( $subpage ) !== '' ) {
786 return Title
::makeTitle( NS_USER
, $wgUser->getName() . '/' . $subpage );
788 return Title
::makeTitle( NS_USER
, $wgUser->getName() );
794 * Shortcut to construct a special page pointing to current user talk page.
795 * @addtogroup SpecialPage
797 class SpecialMytalk
extends UnlistedSpecialPage
{
798 function __construct() {
799 parent
::__construct( 'Mytalk' );
800 $this->mAllowedRedirectParams
= array( 'action' , 'preload' , 'editintro' );
803 function getRedirect( $subpage ) {
805 if ( strval( $subpage ) !== '' ) {
806 return Title
::makeTitle( NS_USER_TALK
, $wgUser->getName() . '/' . $subpage );
808 return Title
::makeTitle( NS_USER_TALK
, $wgUser->getName() );
814 * Shortcut to construct a special page pointing to current user contributions.
815 * @addtogroup SpecialPage
817 class SpecialMycontributions
extends UnlistedSpecialPage
{
818 function __construct() {
819 parent
::__construct( 'Mycontributions' );
822 function getRedirect( $subpage ) {
824 return SpecialPage
::getTitleFor( 'Contributions', $wgUser->getName() );