65 $pattern =
'', $conds = [], $year =
false, $month =
false, $tagFilter =
'',
68 parent::__construct( $list->getContext() );
69 $this->mConds = $conds;
71 $this->mLogEventsList = $list;
78 $this->mTagFilter = $tagFilter;
85 $query = parent::getDefaultQuery();
98 if ( count( $this->types ) ) {
103 if (
$type !==
'patrol' || $this->
getUser()->useNPPatrol() ) {
104 $hide = $this->
getRequest()->getInt(
"hide_{$type}_log", $default );
105 $filters[
$type] = $hide;
107 $this->mConds[] =
'log_type != ' . $this->mDb->addQuotes(
$type );
129 $needReindex =
false;
138 if ( $needReindex ) {
146 $audience =
$types ?
'user' :
'public';
148 if ( $hideLogs !==
false ) {
149 $this->mConds[] = $hideLogs;
152 $this->mConds[
'log_type'] =
$types;
154 if ( count(
$types ) == 1 ) {
155 $this->typeCGI =
$types[0];
170 $usertitle = Title::makeTitleSafe( NS_USER, $name );
171 if ( is_null( $usertitle ) ) {
176 $name = $usertitle->getText();
178 $userid = User::idFromName( $name );
180 $this->mConds[
'log_user_text'] = IP::sanitizeIP( $name );
182 $this->mConds[
'log_user'] = $userid;
186 if ( !$user->isAllowed(
'deletedhistory' ) ) {
188 } elseif ( !$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
193 $this->performer =
$name;
207 if ( $page instanceof
Title ) {
210 $title = Title::newFromText( $page );
211 if ( strlen( $page ) == 0 || !$title instanceof
Title ) {
216 $this->title = $title->getPrefixedText();
217 $ns = $title->getNamespace();
220 $doUserRightsLogLike =
false;
221 if ( $this->types == [
'rights' ] ) {
223 if ( count( $parts ) == 2 ) {
224 list( $name, $database ) = array_map(
'trim', $parts );
225 if ( strstr( $database,
'*' ) ) {
226 $doUserRightsLogLike =
true;
244 $this->mConds[
'log_namespace'] = $ns;
245 if ( $doUserRightsLogLike ) {
247 foreach ( explode(
'*', $database ) as $databasepart ) {
252 $this->mConds[] =
'log_title' . $db->buildLike(
$params );
254 $this->mConds[] =
'log_title' . $db->buildLike( $title->getDBkey(), $db->anyString() );
257 $this->mConds[
'log_title'] = $title->getDBkey();
261 if ( !$user->isAllowed(
'deletedhistory' ) ) {
263 } elseif ( !$user->isAllowedAny(
'suppressrevision',
'viewsuppressed' ) ) {
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
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 );
425 return $this->mTagFilter;
434 $this->mDb->setBigSelects();
436 $this->mDb->setBigSelects(
'default' );
$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.
getUser()
Get the User object.
getRequest()
Get the WebRequest 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.
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
the array() calling protocol came about after MediaWiki 1.4rc1.
info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) action
this hook is for auditing only RecentChangesLinked and Watchlist 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
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
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