Commit graph

50 commits

Author SHA1 Message Date
Prateek Saxena
8aaa50b6ef LogPager: Add backwards-compatibility for hide_[type]_log URL params
Also, the $default value in LogEventsList#getFiltersDesc was not
being generated properly and would have always been an empty array.

Bug: T199856
Change-Id: Id286c76259406521f12cda67a4a715032e022637
2018-07-20 07:18:46 +05:30
Prateek Saxena
38756eae46 Special:Log: Convert to HTMLForm
* All Xml generation code has been removed.

* The LogEventsListGetExtraInputs hook now needs a form
  descriptor array and not plain HTML.
  See I37e0d3e81a46239750465b9299279fbbd7c7f87a.

* LogPager and LogEventList also take the $day parameter
  for 'From date (and earlier)' and pass it to getDateCond
  as well.

* Since FormOptions can't automatically extract the date
  from the request this is being done manually in the
  execute method of Special:Log using MWTimestamp.

Bug: T117737
Change-Id: Iba3c6aa5ac40dcdee0792c2d045b238b02d76521
2018-07-10 16:55:33 +05:30
Matěj Suchánek
1000236bb9 Prevent "Undefined offset notice"
The number provided by the query can be arbitrary, so let's narrow the
input validation to booleans.

Bug: T194616
Change-Id: If03e6e2d5bbcf4f2d85047cc23ee5388b39fe114
2018-06-29 07:42:36 +00:00
Bartosz Dziewoński
286cdb8382 LogPager/LogEventsList: Correct docs about $pattern parameter
$pattern is a boolean, it is documented as "Do a prefix search rather
than an exact title match". However, its type was incorrectly
documented to be a string, and the default value was '' instead of
false (which was harmless, as it is correctly treated as a boolean
value everywhere).

Change-Id: Id093d12891a231d5934f9908e619065afff7380e
2018-05-10 19:46:59 +00:00
Sam Wilson
8e04e60113 Add 'logid' parameter to Special:Log
Make it possible to get a URL for a single log entry,
as an alternative to using Special:Redirect/logid/123.

The existing single-log-entry link of Special:Redirect/logid/123
is also simplified to be a redirect to this new parameter.

Bug: T191608
Bug: T187638
Change-Id: I5f2e52531cd2ba617a25570e40aa8c5168e284d9
2018-05-04 09:52:55 +08:00
Brad Jorsch
fff578a12d Don't target log_user_text for registered users
Apparently when log_user_text was added no one bothered to populate it
for existing rows. Sigh, #Technical-Debt.

Bug: T188826
Change-Id: Ice1e6454e439a4abdf9594f6e964478dd484bc20
2018-03-06 16:22:35 +00:00
Brian Wolff
60aa905006 SECURITY: Fix revdel checks in LogPager
Follow-up to ce881e02e8 where the check for performer
restrictions and action restrictions was reversed.

Bug: T188145
Change-Id: I85a44f925212929ac87fb7a7e494023258f2d148
2018-03-05 22:48:43 +00:00
Brad Jorsch
27c61fb1e9 Add actor table and code to start using it
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.

A subsequent patch will remove the old columns.

Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
2018-02-23 10:06:20 -08:00
Reedy
51fb1e29a0 Fix undefined $db
Bug: T181565
Change-Id: I286374d4ca0ab9435d7d54c4f8b9660a60e5f1e3
2017-11-29 00:21:59 +00:00
cenarium
ce881e02e8 logging: Abstract LogPager enforcing of action and performer restrictions
This avoids duplicating the code in the future, such as proposed for
I3ea2c050b6dd6c (T16711).

Change-Id: Ic53b074f542014f156b006864d91a138ba5fb22b
2017-11-27 19:01:46 -08:00
Brian Wolff
eb1caed560 No longer special case 'patrol' in $wgFilterLogTypes
Previously, if you did not have the right to patrol/view patrolmarks,
you were not allowed to filter Special:Log to remove autopatrol
entries.

Now if wikiadmins want to disable the filtering, they have to
directly change the config value.

This was stupid because:
* Users without patrol rights are just as likely to not care about
  autopatrol spam as users with the priv.
* Sometimes wikiadmins want to hide old patrol log entries even
  after they disabled the patrol feature.

It should be noted there have been two previously attempts at fixing
this issue that didn't go anywhere:
* I9de17fc197a06402a4999a9fb792b86657641f76
* I88448ca0f09069943fd514a5b8213dfdafa57299

Bug: T44246
Change-Id: I590db72c169f3a9ad96c710f088923419d40e48d
2017-10-28 13:08:43 +00:00
Thiemo Mättig
91a920fd85 Remove auto-generated "Constructor" documentation on constructors
Having such comments is worse than not having them. They add zero
information. But you must read the text to understand there is
nothing you don't already know from the class and the method name.

This is similar to I994d11e. Even more trivial, because this here is
about comments that don't say anything but "constructor".

Change-Id: I474dcdb5997bea3aafd11c0760ee072dfaff124c
2017-07-21 12:19:30 +02:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
Roan Kattouw
a70ef33e00 Use IGNORE INDEX(ls_log_id) instead of FORCE INDEX(ls_field_val)
ls_field_val was renamed to PRIMARY, but this is only partially
complete in WMF production. There is only one other index on the
log_search table, so ignoring that one is equivalent to forcing
the other one.

Bug: T17441
Change-Id: I63182a9f94eabb4cc47414d86b02c82bde1e58b0
2017-05-03 08:00:08 -07:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Glaisher
27d95e02fc LogPager: Use normalized value for log_user_text in query condition
Bug: T142755
Change-Id: Ia08be456cafa2133e5ea0e521161d6939e839fb2
2016-09-02 08:23:23 +00:00
rillke
208a99091e Do not validate relevant user name
- This makes Special:Log's behaviour consistent with other special
  pages, e.g. Special:Contributions.

Change-Id: Ic0a9322d920d7514bacac1f29a1da4fe57cae854
2016-04-09 23:51:32 +00:00
cenarium
807650f458 Move action filter logic to LogPager
This moves the action filtering logic from SpecialLog to LogPager,
in a limitAction function, as this seems to be how this is done
for other params (title, performer, etc).
This also uses $pager->getPerformer and getTagFilter() for resp.
performer and tag filter as the options to show, rather than the
raw request values (in a WYSIWYG logic).

Change-Id: I4918a8a2dca3fdbadd7d65c9c9972e6f67a1761b
2016-03-31 22:51:37 +02:00
Reedy
b5656b6953 Many more function case mismatches
Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
2016-03-19 00:20:58 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Siebrand Mazeland
21b0801a2c Fix PHP CS warning in LogPager.php
Change-Id: I31f074ad77309bf02163810eb6689dc0bb56460e
2015-09-28 13:44:39 +02:00
Glaisher
519f901c2f Allow users with 'viewsuppressed' to view when limitTitle()d
This was probably missed when 'suppressrevision' was split into
'suppressrevision' and 'viewsuppressed'.

It was properly separated in limitPerformer() but not in limitTitle().

Bug: T101982
Change-Id: I9c62599124cbb74d2004b416f6e490c231dbd7b2
2015-06-11 17:59:33 +05:00
Kevin Israel
272843a55d Move some global statements to top of function
These were flagged by mediawiki/tools/code-utils/check-vars.php
because they were located inside a switch statement, or inside an
if statement and used outside the statement. All other warnings
from that script are bogus, mostly because the script has no
support for PHP 5.3 namespaces.

Change-Id: If93bae4434b5c28845125095f6a22d6788a76efc
2015-05-06 20:19:32 +00:00
Chad Horohoe
aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00
Marius Hoch
dc3d642809 Make sure $doUserRightsLogLike is set all the times
This fixes a PHP notice

Change-Id: I09b0b0c051b250b1e0a8e937948aaf2c48d17f7c
2014-07-21 22:42:09 +02:00
jenkins-bot
b2645d8284 Merge "Allow wildcard searching in wiki IDs for interwiki user rights logs" 2014-07-21 18:39:20 +00:00
eikes
2f002458d5 Split "suppressrevision" into two user rights
In this change, a new passive user right named "viewsuppressed"
which can be used in order to view suppressed page content was added
to MediaWiki core.
Furthermore, this right was also added to the list of available rights,
to qqq.json and to en.json where also the description of the
"suppressrevision" right was adjusted in order to reflect reality.

Bug: 20476
Change-Id: Id1baacb9c782763db5e05ef8b5c1b761997efcc9
2014-07-19 18:11:15 +02:00
umherirrender
b45420410f Fixed some @params documentation (includes/*)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Iced714bca004756b461b66067a49a925a7e3b877
2014-04-19 22:22:20 +02:00
umherirrender
725d9d125d Removed unneeded spaces and colons in @param and friends
Also swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: Ic36c8c7820a6c2d603f1138130670c6bf6a1ca59
2014-04-08 16:02:49 +00:00
Ladsgroup
a90f1a2d79 Changing URLs of mediawiki.org in scripts to the SSL-based website
http://www.mediawiki.org --> https://www.mediawiki.org

Part 3

Change-Id: Ica633881b1744fa2854f4b012b79dbf5a7e5e7e2
2014-03-13 22:28:14 +00:00
Alex Monk
3f2f32abfe Allow wildcard searching in wiki IDs for interwiki user rights logs
Bug: 10545
Change-Id: I21331d44e5501af3322d0f48dc52001ac5579402
2014-01-25 04:11:17 +00:00
Siebrand Mazeland
142017ca97 Return void for LogPager::limitPerformer and limitTitle
Previously, return values were inconsistent, and according to Chad,
no callers are interested in a return value.

Change-Id: Ib55e7a1c775953f8e90af4b4dedca403c33ac42d
2013-12-30 20:52:51 +01:00
Jackmcbarn
d0664545ec Allow searching for IPs' logs
Update limitPerformer to search for IPs based on log_user_text, rather
than preventing any results from being returned. Also, make a
corresponding adjustment to list=logevents in the API, and remove
indexes to match the LogPager code.

Bug: 58691
Bug: 54404
Change-Id: Iae3f4ee5c7fba5b0b0f4f8fb3e67ac054c7b8dd7
2013-12-23 16:41:39 -05:00
Sean Pringle
f49555f74c identify LogPager queries for load balancing
Change-Id: Ie89cd56700c3d6cbe19457b5b64576a71b3a9876
2013-12-10 14:29:45 +10:00
Siebrand Mazeland
e64f4d9f12 Update documentation for log related classes
Change-Id: I4e00cda46cc7bbcbd17ac2d3d025a76281ee84b6
2013-12-06 00:07:12 +01:00
Siebrand Mazeland
8a536b8591 Update formatting for log related classes
Change-Id: I6535467ed9b22d61b7c5caf3f18067a988871751
2013-12-03 15:36:21 +01:00
umherirrender
0bc583af2c Move closing parenthesis from multi line if and function to own line
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.

Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
2013-12-01 21:39:00 +01:00
Siebrand Mazeland
e61cb8218b Update docs and declare visibility on class props
Change-Id: Ib0f02202d075d4a56dc4e37b08d7ac9399e8c86c
2013-11-01 12:35:27 +01:00
Aaron Schulz
ab19523309 Removed more FORCE INDEX clauses for logging
* Same reasons as 7003a7c5e8

bug: 54876
Change-Id: I743bd21e81395c2866b4241730caa8c5990cc73f
2013-10-02 18:30:33 +00:00
Aaron Schulz
7003a7c5e8 Reduce use of FORCE INDEX in LogPager
* This currently hurts some change tag queries by orders of mangitude.
  MySQL/Maria query planning is also a fair bit smarter than it used to
  be. Lastly, WMF table statistics are better maintained now.

Change-Id: I4d0ac7a35c9cec6b47771aae718b44bfc03bdfbe
2013-09-19 13:08:59 -07:00
Siebrand Mazeland
c4e951d32e Fix inconsistent docs
Change-Id: I4a8d938b4e646ab4401fdf2dbd100401a415b32b
2013-05-09 15:30:37 +02:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +00:00
umherirrender
6c38a5eb72 Fixed spacing in logging/parser/profiler/rl/revdel/search folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I11bbcfa351e945b7bde10c2105d61a3cf5622205
2013-04-20 17:38:24 +02:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
umherirrender
be90ce07b3 fix some spacing
Change-Id: I93f0a87ba7129bc336083e7289247d3150feb606
2013-02-04 19:54:07 +00:00
umherirrender
cefb9ef907 Pass user to LogEventsList::getExcludeClause
This avoids $wgUser in that method

Also removed the double strencode for logtypes,
that is already done by Database::addQuotes/Database::makeList

Change-Id: I5f7f6da06594d92375f74ca48c04d180505642a9
2012-12-19 15:59:54 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Niklas Laxström
35301bc19c Reducy query flood in r96546. Allow formatters to provide titles for LinkBatch. 2012-01-20 16:57:46 +00:00
Niklas Laxström
b18bef923b Split LogPager out of LogEventsList.php 2012-01-20 09:44:39 +00:00