MediaWiki master
SpecialAllMyUploads.php
Go to the documentation of this file.
1<?php
8
12
20
21 public function __construct( private readonly TempUserConfig $tempUserConfig ) {
22 parent::__construct( 'AllMyUploads' );
23
24 $this->mAllowedRedirectParams = [ 'limit', 'ilsearch' ];
25 }
26
28 public function execute( $subpage ) {
29 // Redirect to login for anon users when temp accounts are enabled.
30 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
31 $this->requireLogin();
32 }
33 parent::execute( $subpage );
34 }
35
37 public function getRedirect( $subpage ) {
38 if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
39 return false;
40 }
41
42 $this->mAddedRedirectParams['ilshowall'] = 1;
43 return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
44 }
45
52 public function personallyIdentifiableTarget() {
53 return true;
54 }
55}
60class_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.
__construct(private readonly TempUserConfig $tempUserConfig)
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.