MediaWiki master
SpecialMyuploads.php
Go to the documentation of this file.
1<?php
8
12
19
20 public function __construct( private readonly TempUserConfig $tempUserConfig ) {
21 parent::__construct( 'Myuploads' );
22
23 $this->mAllowedRedirectParams = [ 'limit', 'ilshowall', 'ilsearch' ];
24 }
25
27 public function execute( $subpage ) {
28 // Redirect to login for anon users when temp accounts are enabled.
29 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
30 $this->requireLogin();
31 }
32 parent::execute( $subpage );
33 }
34
36 public function getRedirect( $subpage ) {
37 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
38 return false;
39 }
40
41 return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
42 }
43
50 public function personallyIdentifiableTarget() {
51 return true;
52 }
53}
58class_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.
__construct(private readonly TempUserConfig $tempUserConfig)
personallyIdentifiableTarget()
Target identifies a specific User.
getRedirect( $subpage)
If the special page is a redirect, then get the Title object it redirects to.False otherwise....
Interface for temporary user creation config and name matching.