33 parent::__construct(
'Log' );
42 $out->addModules(
'mediawiki.userSuggest' );
43 $out->addModuleStyles(
'mediawiki.interface.helpers.styles' );
47 $opts->
add(
'type',
'' );
48 $opts->add(
'user',
'' );
49 $opts->add(
'page',
'' );
50 $opts->add(
'pattern',
false );
54 $opts->add(
'tagfilter',
'' );
55 $opts->add(
'offset',
'' );
56 $opts->add(
'dir',
'' );
57 $opts->add(
'offender',
'' );
58 $opts->add(
'subtype',
'' );
59 $opts->add(
'logid',
'' );
62 $opts->fetchValuesFromRequest( $this->
getRequest() );
63 if ( $par !==
null ) {
68 $dateString = $this->
getRequest()->getVal(
'wpdate' );
69 if ( !empty( $dateString ) ) {
71 $dateStamp = MWTimestamp::getInstance( $dateString .
' 00:00:00' );
72 }
catch ( TimestampException
$e ) {
78 $opts->setValue(
'year', (
int)$dateStamp->format(
'Y' ) );
79 $opts->setValue(
'month', (
int)$dateStamp->format(
'm' ) );
80 $opts->setValue(
'day', (
int)$dateStamp->format(
'd' ) );
84 # Don't let the user get stuck with a certain date
85 if ( $opts->getValue(
'offset' ) || $opts->getValue(
'dir' ) ==
'prev' ) {
86 $opts->setValue(
'year',
'' );
87 $opts->setValue(
'month',
'' );
93 $logRestrictions = $this->
getConfig()->get(
'LogRestrictions' );
94 $type = $opts->getValue(
'type' );
96 $opts->setValue(
'type',
'' );
98 && !$this->
getUser()->isAllowed( $logRestrictions[
$type] )
103 # Handle type-specific inputs
105 if ( $opts->getValue(
'type' ) ==
'suppress' ) {
106 $offenderName = $opts->getValue(
'offender' );
110 $qc = [
'ls_field' =>
'target_author_actor',
'ls_value' => $offender->getActorId() ];
111 }
elseif ( $offender->getId() > 0 ) {
112 $qc = [
'ls_field' =>
'target_author_id',
'ls_value' => $offender->getId() ];
114 $qc = [
'ls_field' =>
'target_author_ip',
'ls_value' => $offender->getName() ];
120 'SpecialLogAddLogSearchRelations',
121 [ $opts->getValue(
'type' ), $this->getRequest(), &$qc ]
125 # Some log types are only for a 'User:' title but we might have been given
126 # only the username instead of the full title 'User:username'. This part try
127 # to lookup for a user by that name and eventually fix user input. See T3697.
128 if (
in_array( $opts->getValue(
'type' ), self::getLogTypesOnUser() ) ) {
129 # ok we have a type of log which expect a user title.
130 $target = Title::newFromText( $opts->getValue(
'page' ) );
131 if ( $target && $target->getNamespace() ===
NS_MAIN ) {
132 # User forgot to add 'User:', we are adding it for him
133 $opts->setValue(
'page',
134 Title::makeTitleSafe( NS_USER, $opts->getValue(
'page' ) )
139 $this->
show( $opts, $qc );
151 static $types =
null;
152 if ( $types !==
null ) {
161 Hooks::run(
'GetLogTypesOnUser', [ &$types ] );
188 $par = $par !==
null ? $par :
'';
189 $parms = explode(
'/', $par );
190 $symsForAll = [
'*',
'all' ];
191 if ( $parms[0] !=
'' &&
195 }
elseif ( count( $parms ) == 2 ) {
196 $opts->
setValue(
'type', $parms[0] );
197 $opts->
setValue(
'user', $parms[1] );
204 # Create a LogPager item to get the results and a LogEventsList item to format them...
229 if ( $pager->getPerformer() ) {
231 $this->
getSkin()->setRelevantUser( $performerUser );
235 $loglist->showOptions(
237 $pager->getPerformer(),
239 $pager->getPattern(),
243 $pager->getFilterParams(),
244 $pager->getTagFilter(),
249 $logBody = $pager->getBody();
252 $pager->getNavigationBar() .
253 $this->getActionButtons(
254 $loglist->beginLogEventsList() .
256 $loglist->endLogEventsList()
258 $pager->getNavigationBar()
261 $this->
getOutput()->addWikiMsg(
'logempty' );
267 $canRevDelete = $user->isAllowedAll(
'deletedhistory',
'deletelogentry' );
269 # If the user doesn't have the ability to delete log entries nor edit tags,
270 # don't bother showing them the button(s).
271 if ( !$canRevDelete && !$showTagEditUI ) {
275 # Show button to hide log entries and/or edit change tags
276 $s = Html::openElement(
278 [
'action' =>
wfScript(),
'id' =>
'mw-log-deleterevision-submit' ]
280 $s .= Html::hidden(
'action',
'historysubmit' ) .
"\n";
281 $s .= Html::hidden(
'type',
'logging' ) .
"\n";
284 if ( $canRevDelete ) {
285 $buttons .= Html::element(
289 'name' =>
'revisiondelete',
291 'class' =>
"deleterevision-log-submit mw-log-deleterevision-button"
293 $this->
msg(
'showhideselectedlogentries' )->
text()
296 if ( $showTagEditUI ) {
297 $buttons .= Html::element(
301 'name' =>
'editchangetags',
303 'class' =>
"editchangetags-log-submit mw-log-editchangetags-button"
305 $this->
msg(
'log-edit-tags' )->
text()
311 $s .= $buttons . $formcontents . $buttons;
312 $s .= Html::closeElement(
'form' );
324 $this->
getOutput()->setPageTitle( $page->getName() );
325 $this->
getOutput()->addHTML( $page->getDescription()
326 ->setContext( $this->getContext() )->parseAsBlock() );
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
int $wgActorTableSchemaMigrationStage
Actor table schema migration stage.
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Class for generating clickable toggle links for a list of checkboxes.
Class to simplify the use of log pages.
static isLogType( $type)
Is $type a valid log type.
static validTypes()
Get the list of valid log types.
Show an error when a user tries to do something they do not have the necessary permissions for.
A special page that lists log entries.
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept.
execute( $par)
Default execute method Checks user permissions.
static getLogTypesOnUser()
List log type for which the target is a user Thus if the given target is in NS_MAIN we can alter it t...
show(FormOptions $opts, array $extraConds)
parseParams(FormOptions $opts, $par)
Set options based on the subpage title parts:
getActionButtons( $formcontents)
addHeader( $type)
Set page title and show header for this log type.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Parent class for all special pages.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getUser()
Shortcut to get the User executing this instance.
getSkin()
Shortcut to get the skin being used for this instance.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
getRequest()
Get the WebRequest being used for this instance.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
returning false will NOT prevent logging $e
const SCHEMA_COMPAT_READ_NEW
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))