MediaWiki
master
SpecialMylog.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\Specials\Redirects
;
22
23
use
LogPage
;
24
use
MediaWiki\SpecialPage\RedirectSpecialPage
;
25
use
MediaWiki\SpecialPage\SpecialPage
;
26
use
MediaWiki\Title\Title
;
27
use
MediaWiki\User\TempUser\TempUserConfig
;
28
34
class
SpecialMylog
extends
RedirectSpecialPage
{
35
36
private
TempUserConfig
$tempUserConfig;
37
41
public
function
__construct
(
TempUserConfig
$tempUserConfig ) {
42
parent::__construct(
'Mylog'
);
43
44
$this->tempUserConfig = $tempUserConfig;
45
46
$this->mAllowedRedirectParams = [
'type'
,
'subtype'
,
'page'
,
'pattern'
,
47
'tagfilter'
,
'tagInvert'
,
'offset'
,
'dir'
,
'offender'
,
48
'year'
,
'month'
,
'day'
];
49
}
50
55
public
function
getRedirect
( $subpage ) {
56
// Redirect to login for anon users when temp accounts are enabled.
57
if
( $this->tempUserConfig->isEnabled() && $this->getUser()->isAnon() ) {
58
$this->
requireLogin
();
59
}
60
61
if
( $subpage ===
null
|| $subpage ===
''
) {
62
return
SpecialPage::getSafeTitleFor
(
'Log'
, $this->
getUser
()->
getName
() );
63
}
64
65
return
SpecialPage::getSafeTitleFor
(
'Log'
, $subpage .
'/'
. $this->
getUser
()->
getName
() );
66
}
67
73
public
function
personallyIdentifiableTarget
() {
74
return
true
;
75
}
76
82
public
function
getSubpagesForPrefixSearch
() {
83
$subpages = LogPage::validTypes();
84
$subpages[] =
'all'
;
85
sort( $subpages );
86
return
$subpages;
87
}
88
}
89
94
class_alias( SpecialMylog::class,
'SpecialMylog'
);
LogPage
Class to simplify the use of log pages.
Definition
LogPage.php:45
MediaWiki\SpecialPage\RedirectSpecialPage
Shortcut to construct a special page alias.
Definition
RedirectSpecialPage.php:33
MediaWiki\SpecialPage\SpecialPage
Parent class for all special pages.
Definition
SpecialPage.php:66
MediaWiki\SpecialPage\SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition
SpecialPage.php:896
MediaWiki\SpecialPage\SpecialPage\getSafeTitleFor
static getSafeTitleFor( $name, $subpage=false)
Get a localised Title object for a page name with a possibly unvalidated subpage.
Definition
SpecialPage.php:183
MediaWiki\SpecialPage\SpecialPage\requireLogin
requireLogin( $reasonMsg='exception-nologin-text', $titleMsg='exception-nologin')
If the user is not logged in, throws UserNotLoggedIn error.
Definition
SpecialPage.php:434
MediaWiki\SpecialPage\SpecialPage\getName
getName()
Get the canonical, unlocalized name of this special page without namespace.
Definition
SpecialPage.php:226
MediaWiki\Specials\Redirects\SpecialMylog
Redirect to Special:Log for the current user's name or IP.
Definition
SpecialMylog.php:34
MediaWiki\Specials\Redirects\SpecialMylog\getSubpagesForPrefixSearch
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept.
Definition
SpecialMylog.php:82
MediaWiki\Specials\Redirects\SpecialMylog\getRedirect
getRedirect( $subpage)
Definition
SpecialMylog.php:55
MediaWiki\Specials\Redirects\SpecialMylog\personallyIdentifiableTarget
personallyIdentifiableTarget()
Target identifies a specific User.
Definition
SpecialMylog.php:73
MediaWiki\Specials\Redirects\SpecialMylog\__construct
__construct(TempUserConfig $tempUserConfig)
Definition
SpecialMylog.php:41
MediaWiki\Title\Title
Represents a title within MediaWiki.
Definition
Title.php:78
MediaWiki\User\TempUser\TempUserConfig
Interface for temporary user creation config and name matching.
Definition
TempUserConfig.php:18
MediaWiki\Specials\Redirects
Definition
SpecialAllMyUploads.php:21
includes
specials
redirects
SpecialMylog.php
Generated on Sat Oct 5 2024 15:25:24 for MediaWiki by
1.10.0