MediaWiki master
SpecialMycontributions.php
Go to the documentation of this file.
1<?php
23
28
35
36 private TempUserConfig $tempUserConfig;
37
38 public function __construct( TempUserConfig $tempUserConfig ) {
39 parent::__construct( 'Mycontributions' );
40
41 $this->tempUserConfig = $tempUserConfig;
42
43 $this->mAllowedRedirectParams = [ 'limit', 'namespace', 'tagfilter',
44 'offset', 'dir', 'year', 'month', 'feed', 'deletedOnly',
45 'nsInvert', 'associated', 'newOnly', 'topOnly', 'start', 'end',
46 'returnto' ];
47 }
48
53 public function getRedirect( $subpage ) {
54 // Redirect to login for anon users when temp accounts are enabled.
55 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
56 $this->requireLogin();
57 }
58
59 return SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() );
60 }
61
68 public function personallyIdentifiableTarget() {
69 return true;
70 }
71}
76class_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.