| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
namespace MediaWiki\Specials\Redirects; |
| 23 |
|
| 24 |
use MediaWiki\SpecialPage\RedirectSpecialPage; |
| 25 |
use MediaWiki\SpecialPage\SpecialPage; |
| 26 |
use MediaWiki\Title\Title; |
| 27 |
use MediaWiki\User\TempUser\TempUserConfig; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
class SpecialMycontributions extends RedirectSpecialPage { |
| 35 |
|
| 36 |
private TempUserConfig $tempUserConfig; |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
public function __construct( TempUserConfig $tempUserConfig ) { |
| 42 |
parent::__construct( 'Mycontributions' ); |
| 43 |
|
| 44 |
$this->tempUserConfig = $tempUserConfig; |
| 45 |
|
| 46 |
$this->mAllowedRedirectParams = [ 'limit', 'namespace', 'tagfilter', |
| 47 |
'offset', 'dir', 'year', 'month', 'feed', 'deletedOnly', |
| 48 |
'nsInvert', 'associated', 'newOnly', 'topOnly', 'start', 'end', |
| 49 |
'returnto' ]; |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
public function getRedirect( $subpage ) { |
| 57 |
|
| 58 |
if ( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) { |
| 59 |
$this->requireLogin(); |
| 60 |
} |
| 61 |
|
| 62 |
return SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() ); |
| 63 |
} |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
public function personallyIdentifiableTarget() { |
| 72 |
return true; |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
class_alias( SpecialMycontributions::class, 'SpecialMycontributions' ); |