MediaWiki master
SpecialMyuploads.php
Go to the documentation of this file.
1<?php
22
27
34
35 private TempUserConfig $tempUserConfig;
36
37 public function __construct( TempUserConfig $tempUserConfig ) {
38 parent::__construct( 'Myuploads' );
39
40 $this->tempUserConfig = $tempUserConfig;
41 $this->mAllowedRedirectParams = [ 'limit', 'ilshowall', 'ilsearch' ];
42 }
43
48 public function getRedirect( $subpage ) {
49 // Redirect to login for anon users when temp accounts are enabled.
50 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
51 $this->requireLogin();
52 }
53
54 return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
55 }
56
63 public function personallyIdentifiableTarget() {
64 return true;
65 }
66}
71class_alias( SpecialMyuploads::class, 'SpecialMyuploads' );
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:Listfiles for the current user's name or IP.
personallyIdentifiableTarget()
Target identifies a specific User.
__construct(TempUserConfig $tempUserConfig)
Represents a title within MediaWiki.
Definition Title.php:78
Interface for temporary user creation config and name matching.