MediaWiki 1.43.1
SpecialMycontributions.php
Go to the documentation of this file.
1<?php
23
28
35
36 private TempUserConfig $tempUserConfig;
37
41 public function __construct( TempUserConfig $tempUserConfig ) {
42 parent::__construct( 'Mycontributions' );
43
44 $this->tempUserConfig = $tempUserConfig;
45
46 $this->mAllowedRedirectParams = [ 'limit', 'namespace', 'tagfilter',
47 'offset', 'dir', 'year', 'month', 'feed', 'deletedOnly',
48 'nsInvert', 'associated', 'newOnly', 'topOnly', 'start', 'end',
49 'returnto' ];
50 }
51
56 public function getRedirect( $subpage ) {
57 // Redirect to login for anon users when temp accounts are enabled.
58 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
59 $this->requireLogin();
60 }
61
62 return SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() );
63 }
64
71 public function personallyIdentifiableTarget() {
72 return true;
73 }
74}
79class_alias( SpecialMycontributions::class, 'SpecialMycontributions' );
Shortcut to construct a special page alias.
Parent class for all special pages.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
getUser()
Shortcut to get the User executing this instance.
requireLogin( $reasonMsg='exception-nologin-text', $titleMsg='exception-nologin')
If the user is not logged in, throws UserNotLoggedIn error.
getName()
Get the canonical, unlocalized name of this special page without namespace.
Redirect to Special:Contributions for the current user's name or IP.
personallyIdentifiableTarget()
Target identifies a specific User.
Represents a title within MediaWiki.
Definition Title.php:78
Interface for temporary user creation config and name matching.