72 $pattern =
false, $conds = [], $year =
false, $month =
false, $day =
false,
73 $tagFilter =
'',
$action =
'', $logId =
false
75 parent::__construct( $list->getContext() );
76 $this->mConds = $conds;
78 $this->mLogEventsList = $list;
85 $this->mTagFilter = $tagFilter;
92 $query = parent::getDefaultQuery();
106 if ( count( $this->types ) ) {
110 $wpfilters = $this->
getRequest()->getArray(
"wpfilters" );
111 $request_filters = $wpfilters ===
null ? [] : $wpfilters;
114 $hide = !in_array(
$type, $request_filters );
117 if ( $wpfilters ===
null ) {
118 $hide = $this->
getRequest()->getBool(
"hide_{$type}_log", $default );
121 $filters[
$type] = $hide;
123 $this->mConds[] =
'log_type != ' . $this->mDb->addQuotes(
$type );
144 $needReindex =
false;
153 if ( $needReindex ) {
161 $audience =
$types ?
'user' :
'public';
163 if ( $hideLogs !==
false ) {
164 $this->mConds[] = $hideLogs;
167 $this->mConds[
'log_type'] =
$types;
169 if ( count(
$types ) == 1 ) {
170 $this->typeCGI =
$types[0];
185 $usertitle = Title::makeTitleSafe( NS_USER, $name );
186 if ( is_null( $usertitle ) ) {
191 $name = $usertitle->getText();
194 $this->mConds[] = ActorMigration::newMigration()->getWhere(
200 $this->performer =
$name;
214 if ( $page instanceof
Title ) {
217 $title = Title::newFromText( $page );
218 if ( strlen( $page ) == 0 || !$title instanceof
Title ) {
223 $this->title = $title->getPrefixedText();
224 $ns = $title->getNamespace();
227 $doUserRightsLogLike =
false;
228 if ( $this->types == [
'rights' ] ) {
230 if ( count( $parts ) == 2 ) {
231 list( $name, $database ) = array_map(
'trim', $parts );
232 if ( strstr( $database,
'*' ) ) {
233 $doUserRightsLogLike =
true;
251 $this->mConds[
'log_namespace'] = $ns;
252 if ( $doUserRightsLogLike ) {
254 foreach ( explode(
'*', $database ) as $databasepart ) {
259 $this->mConds[] =
'log_title' . $db->buildLike(
$params );
261 $this->mConds[] =
'log_title' . $db->buildLike( $title->getDBkey(), $db->anyString() );
264 $this->mConds[
'log_title'] = $title->getDBkey();
278 if (
$type ===
'' ) {
283 if ( isset( $actions[
$type] ) ) {
285 $this->mLogEventsList->setAllowedActions( array_keys( $actions[
$type] ) );
302 $this->mConds[
'log_id'] = $logId;
314 $fields = $basic[
'fields'];
315 $conds = $basic[
'conds'];
317 $joins = $basic[
'join_conds'];
319 # Add log_search table if there are conditions on it.
320 # This filters the results to only include log rows that have
321 # log_search records with the specified ls_field and ls_value values.
322 if ( array_key_exists(
'ls_field', $this->mConds ) ) {
324 $options[
'IGNORE INDEX'] = [
'log_search' =>
'ls_log_id' ];
325 $options[
'USE INDEX'] = [
'logging' =>
'PRIMARY' ];
329 # Since (ls_field,ls_value,ls_logid) is unique, if the condition is
330 # to match a specific (ls_field,ls_value) tuple, then there will be
331 # no duplicate log rows. Otherwise, we need to remove the duplicates.
335 # Don't show duplicate rows when using log_search
336 $joins[
'log_search'] = [
'INNER JOIN',
'ls_log_id=log_id' ];
341 'conds' => array_merge( $conds, $this->mConds ),
343 'join_conds' => $joins,
345 # Add ChangeTags filter query
346 ChangeTags::modifyDisplayQuery( $info[
'tables'], $info[
'fields'], $info[
'conds'],
347 $info[
'join_conds'], $info[
'options'], $this->mTagFilter );
359 array_key_exists( $field, $this->mConds ) &&
360 ( !is_array( $this->mConds[$field] ) || count( $this->mConds[$field] ) == 1 )
365 return 'log_timestamp';
369 # Do a link batch query
372 foreach ( $this->mResult as $row ) {
373 $lb->
add( $row->log_namespace, $row->log_title );
374 $lb->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) );
375 $lb->addObj( Title::makeTitleSafe(
NS_USER_TALK, $row->user_name ) );
377 foreach ( $formatter->getPreloadTitles() as $title ) {
378 $lb->addObj( $title );
382 $this->mResult->seek( 0 );
389 return $this->mLogEventsList->logLine( $row );
432 return $this->mTagFilter;
441 $this->mDb->setBigSelects();
443 $this->mDb->setBigSelects(
'default' );
450 if ( $this->actionRestrictionsEnforced ) {
453 $this->actionRestrictionsEnforced =
true;
455 if ( !$user->isAllowed(
'deletedhistory' ) ) {
457 } elseif ( !$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
468 if ( $this->performerRestrictionsEnforced ) {
471 $this->performerRestrictionsEnforced =
true;
473 if ( !$user->isAllowed(
'deletedhistory' ) ) {
475 } elseif ( !$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
$wgUserrightsInterwikiDelimiter
Character used as a delimiter when testing for interwiki userrights (In Special:UserRights,...
$wgLogRestrictions
This restricts log access to those who have a certain right Users without this will not see it in the...
$wgActionFilteredLogs
List of log types that can be filtered by action types.
$wgFilterLogTypes
Show/hide links on Special:Log will be shown for these log types.
$wgMiserMode
Disable database-intensive features.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
static getExcludeClause( $db, $audience='public', User $user=null)
SQL clause to skip forbidden log types for this user.
Represents a title within MediaWiki.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
this hook is for auditing only RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
Allows to change the fields on the form that will be generated $name
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
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))