MediaWiki master
SpecialAllMyUploads.php
Go to the documentation of this file.
1<?php
8
12
20
21 private TempUserConfig $tempUserConfig;
22
23 public function __construct( TempUserConfig $tempUserConfig ) {
24 parent::__construct( 'AllMyUploads' );
25
26 $this->tempUserConfig = $tempUserConfig;
27
28 $this->mAllowedRedirectParams = [ 'limit', 'ilsearch' ];
29 }
30
32 public function execute( $subpage ) {
33 // Redirect to login for anon users when temp accounts are enabled.
34 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
35 $this->requireLogin();
36 }
37 parent::execute( $subpage );
38 }
39
41 public function getRedirect( $subpage ) {
42 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
43 return false;
44 }
45
46 $this->mAddedRedirectParams['ilshowall'] = 1;
47 return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
48 }
49
56 public function personallyIdentifiableTarget() {
57 return true;
58 }
59}
64class_alias( SpecialAllMyUploads::class, 'SpecialAllMyUploads' );
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 current user's uploaded files, including old versions.
getRedirect( $subpage)
If the special page is a redirect, then get the Title object it redirects to.False otherwise....
personallyIdentifiableTarget()
Target identifies a specific User.
Interface for temporary user creation config and name matching.