Commit graph

103 commits

Author SHA1 Message Date
Matěj Suchánek
eff3f30dd1 Sort user groups in Special:Listusers
This is already done in Special:Activeusers (via UsersPager.php).

Also declare the variable.

Change-Id: Ieb2ef14727e7f16a23093ffd36f52c44e5bb197a
2018-04-28 10:03:15 +02: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
This, that and the other
73224f4f8b User group memberships that expire
This patch adds an ug_expiry column to the user_groups table, a timestamp
giving a date when the user group expires. A new UserGroupMembership class,
based on the Block class, manages entries in this table.

When the expiry date passes, the row in user_groups is ignored, and will
eventually be purged from the DB when UserGroupMembership::insert is next
called. Old, expired user group memberships are not kept; instead, the log
entries are available to find the history of these memberships, similar
to the way it has always worked for blocks and protections.

Anyone getting user group info through the User object will get correct
information. However, code that reads the user_groups table directly will
now need to skip over rows with ug_expiry < wfTimestampNow(). See
UsersPager for an example of how to do this.

NULL is used to represent infinite (no) expiry, rather than a string
'infinity' or similar (except in the API). This allows existing user group
assignments and log entries, which are all infinite in duration, to be
treated the same as new, infinite-length memberships, without special
casing everything.

The whole thing is behind the temporary feature flag
$wgDisableUserGroupExpiry, in accordance with the WMF schema change policy.

The opportunity has been taken to refactor some static user-group-related
functions out of User into UserGroupMembership, and also to add a primary
key (ug_user, ug_group) to the user_groups table.

There are a few breaking changes:
- UserRightsProxy-like objects are now required to have a
  getGroupMemberships() function.
- $user->mGroups (on a User object) is no longer present.
- Some protected functions in UsersPager are altered or removed.
- The UsersPagerDoBatchLookups hook (unused in any Wikimedia Git-hosted
  extension) has a change of parameter.

Bug: T12493
Depends-On: Ia9616e1e35184fed9058d2d39afbe1038f56d7fa
Depends-On: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
Change-Id: I93c955dc7a970f78e32aa503c01c67da30971d1a
2017-01-27 09:24:20 +00:00
Niklas Laxström
d7eb9c3366 SpecialActiveUsers: escape group names
Change-Id: I1a4d1501b8481d9f670916818fe7f75e983c2800
2016-11-30 14:53:11 +01:00
Bartosz Dziewoński
2d78b8d44e SpecialActiveUsers: Allow excluding groups too
Also restore support for old 'hidebots' and 'hidesysops' options.

Bug: T116354
Change-Id: I68887509c3dbf74598a1af82623b9f0f5a1ab43d
2016-11-21 19:21:37 +00:00
Sethakill
d115a79923 SpecialActiveUsers: Change checkboxes to dropdown
Moved form to new function and
fixed text about cached version.

Bug: T116354
Change-Id: I29ae63472536f99f7f9546f30d86e7bd324d3094
2016-11-02 12:21:26 +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
Sethakill
b3492e41f9 Convert Special:Activeusers to use OOUI
Moved FormOptions and form from pager
and recreated it with HtmlForm.

Bug: T117733
Change-Id: Ia330bee63ad17bb75e715cd95e407d5e43310177
2016-05-09 00:51:55 +02:00
addshore
f51b1cd9ec Split Pager classes out of SpecialPage files
Change-Id: I6c8dbc9084040dd3b8a5e19caaf076bd14b77762
2016-03-24 11:39:38 +00:00
addshore
8f0c7432ca Dont count RC_CATEGORIZE in Special:ActiveUsers
Bug: T130550
Change-Id: Ia2296586d35bb21085fcf386f26ad6f4e765e534
2016-03-24 11:02:29 +00:00
umherirrender
bc5d873d76 Fix autofocus on Special:Activeusers
Xml::inputLabel does not know about boolean parameters like autofocus,
so add it with an empty value or omitted it.

Fix validation error:
Bad value 1 for attribute autofocus on element input.

Change-Id: Idb7a7b58079d6c44b5a7f1fa226218bb685c8241
2016-02-24 20:40:53 +01: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
umherirrender
a839730908 Pass function to Database::selectField in SpecialActiveusers.php
Change-Id: Ie58b484cb8add682c7a0c138af2c3268faf7b383
2016-02-02 21:12:57 +01:00
umherirrender
54c1e18eec Remove various double empty newlines
The double empty newline is not needed between functions, variable or at
end of file

Change-Id: Ib866a95084c4601ac150a2b402cfa184ebc18afa
2015-12-27 18:55:12 +00:00
PranavK
9e195d7f7b Localisation: Gave each special page its own message
Bug: T45502
Change-Id: I6d41c2174a67bc9b231b6fc6209677fb84692cc5
2015-12-11 17:42:03 +05:30
umherirrender
516c6bf62a Add user autocomplete and autofocus to Special:ActiveUsers
Add autocomplete and autofocus as already exists on Special:ListUsers

Change-Id: I7a89023491cfff4d36c3214a4d56d4c0d35d192e
2015-12-06 15:04:39 +00:00
Aaron Schulz
578bb759b6 Improved ActiveUsers cache staleness estimates
Change-Id: Iddbdd90ff91d65f93dc51da0c8a5c0d4d0ab219f
2015-04-24 00:23:34 -07:00
Aaron Schulz
d834197821 Moved ActiveUsers updates to recent changes jobs
* This avoids writes on view and is more reliable
* Also made the wfWaitForSlaves() there actually work

Bug: T95501
Bug: T92357
Bug: T89027
Change-Id: I0a006fc92a9268feb185c9d88aa04002ea51ecd3
2015-04-22 19:13:37 +00:00
Aaron Schulz
561e04729b Made mergeActiveUsers use "recentchanges" query group
Change-Id: I9b91fe5d81f7315d531c48530cfbcf779f3adec2
2015-04-07 17:31:11 -07:00
Aaron Schulz
8a4eae05cb Made ActiveUsers work a bit better on small wikis
bug: T89027
Change-Id: If0fc4b51b89170e000cf42bdc3e782e42323a440
2015-02-17 10:33:01 -08:00
umherirrender
975646b514 Skip cache hint about 0 seconds on Special:ActiveUsers
When the data on Special:ActiveUsers are up to date there is no need to
give a hint, seeing data from cache "which can be up to 0 seconds".

Change-Id: I46f80c7cdc083b997794fb9398887e2ef0088684
2015-01-11 11:39:20 +01:00
Jeff Janes
52328f043c PostgreSQL: Fix Special:ActiveUsers GROUP BY query
For GROUP BY queries, PostgreSQL require all columns in the
unaggregated part of the select list to also be in the
GROUP BY list.

To fix this, add user_name and user_id to the GROUP BY list along side
qcc_title.

This addition cannot change the query results, because user_name and
user_id are functionally dependent on qcc_title: user_name because
of the WHERE clause for this query, and user_id due to the 1 to 1
relationship between user_name and user_id enforced by their unique
and not null constraints on the underlying table.

This has been tested on PostgreSQL and MySQL.

Bug: 68087
Change-Id: I3aed715b40ff6e2290220122acbda0f0e74b5b36
2015-01-06 13:40:06 -08:00
umherirrender
c4030ede03 Add batch lookup for user groups and titles on Special:ActiveUsers
Call parent of doBatchLookups to get the LinkBatch for the userpages.
Use than the populated user group cache to get the groups from to
display them.

Follow-Up: I4a945f83ad28edf5cc040139943cf743cb3d133c
Change-Id: Ibbabf40d60dd9f8e3667cf17455e7582b4ee472a
2014-12-29 22:45:14 +01:00
Aaron Schulz
2fe030d7e1 Changed some DatabaseBase type hints to IDatabase
Change-Id: Id945aaabbf5b467106676ea9f3eab3a6161c7f3d
2014-12-02 23:34:44 -08:00
Aaron Schulz
14733fc007 Lowered ActiveUsers query period to reduce timeouts
Change-Id: If34266cbac79d319fe33e1f362791fb438577fd7
2014-09-29 11:43:22 -07:00
Aaron Schulz
958a13b025 Created DatabaseBase::trxTimestamp method and added usage in ActiveUsers query
Change-Id: Iba3c83ce8010583908f9dbaa8348f7226f524793
2014-09-24 22:38:36 +00:00
Aaron Schulz
9e2b790fc2 Fixes to prevent duplicate rows in ActiveUser cache
* Handle repeatable-read snapshots better for web requests
* In CLI mode, handle automatic reconnects better (rolling
  back). It has to abort since it lost the lock in that case.

bug: 71086
Change-Id: I5228889cf05857c87a06f7d073b5aa46f0c240be
2014-09-23 15:14:59 -07:00
Prateek Saxena
f8243463dd Special:ActiveUsers: Use mw-ui-input-inline
Bug: 71142
Change-Id: Ie737b8bd74179ce916747c5e9cd23304e2ad8b16
2014-09-22 14:51:00 -07:00
Yuri Astrakhan
703464a88c Cleanup - let's make IDEs more useful
http://phpdoc.org/docs/latest/references/phpdoc/types.html

If IDEs have many warnings, we don't look at them.
Let's minimize the number of warnings, and make them useful again.

* Some function docs fixes
* Removed unused $iwprefixes var in ApiQuerySearch.php
* declared private $blockStatusByUid in SpecialActiveusers
* declared private $repo in UploadFromChunks

Change-Id: Ifd20f78b168b9a913fdb8d89dc26a76a173b1c29
2014-08-13 16:02:59 -04:00
Kunal Mehta
9e1f4a6974 SpecialActiveusers: Use Config objects instead of globals
Except for SpecialActiveUsers::cacheUpdate because I couldn't figure
out what was calling that.

Change-Id: Ib37beba34d41e2a27e4d87f1b2d7654d519334f8
2014-08-03 14:19:24 -07:00
Aaron Schulz
2ef08d7d49 Fixed initial as-of cache time shown at Special:ActiveUsers
Change-Id: I97c662a0c2b912924df07bd2cde790535026005c
2014-07-17 12:32:51 -07:00
Aaron Schulz
f49907ac0a Avoid wfWaitForSlaves() call when in a transaction in ActiveUsers
* This does not do anything except waste time and connections.
  The query should be small in that case anyway.

Change-Id: I010b3f09be36202ccf408e1a2b084fee0a598ff9
2014-07-09 13:02:29 -07:00
Brad Jorsch
bb3e01947f Properly count actions in Special:ActiveUsers
The cache of active users maintained by Special:ActiveUsers filters out
certain actions, but the displayed action count does not. Fix this.

Change-Id: Ifb9035a08328587c43c46520c5062602b9b9c6f5
2014-07-01 15:55:43 -04:00
Siebrand Mazeland
ad957a706d Pass phpcs-strict on includes/specials/ (1/3)
Change-Id: Ib4522f22551ed5501e1ab7767b8f481fe6cd72d2
2014-05-09 21:33:58 +02:00
umherirrender
f971300427 Fixed some @params documentation (includes/[specialpage|specials])
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: Icf6f36bb53322b39cd5c89523dbd0e4ab10b9ec9
2014-04-19 10:16:52 +02:00
Brian Wolff
56524c050d Exclude external RC entries (e.g. Wikidata) from Special:ActiveUsers
People usually want to know who the active users are on the local
wiki, not who edited something on Wikidata.

Note, this changes the query to no longer use a covering index
when joining against the recentchanges table when displaying
the page.

Bug: 63769
Change-Id: I919123f396d0901822108a4675593a2ff5b7307f
2014-04-10 16:37:29 -03:00
Siebrand Mazeland
374cce86c8 Update formatting for includes/specials/
Change-Id: I478dedd0b692eae002a0ca9b0ec15cb2c357411f
2014-03-23 11:19:12 +00:00
Aaron Schulz
07e8e9a65a Avoid showing crazy staleness times at ActiveUsers
* Also do the query more aggressively on small wikis

Change-Id: I089b2f69d03bb289035be11ccfe4937931904d25
2014-02-28 15:28:27 -08:00
Aaron Schulz
b7b0e54f08 Fixed use of qcc_value by Special:ActiveUsers
* This should just be a UNIX timestamp.

Change-Id: I5197986a448dba957358a4575273794b8ac6361d
2014-02-04 13:50:55 -08:00
Aaron Schulz
87be24dbdf Made ActiveUsers use querycache and do staggered updates on view
Bug: 41078
Change-Id: Id9c2377e0d2636fa9aaed01839678e2b8abe824e
2014-02-04 20:14:40 +00:00
Alex Monk
6c8b2b5dbc Set taborder on Special:ActiveUsers
Order: 'Display users starting at' text box, hide bots checkbox, hide admins checkbox, go button

Bug: 43558
Change-Id: Ib32b43324abd0295b029f9b8e6c5af17b6570d4f
2013-07-01 15:51:20 +01:00
Aaron Schulz
b0b4988737 Fixed bug where FORCE INDEX did not make it to the SQL.
Change-Id: Id19d7b2e9453faf9031a7409329376b98a2fbb17
2013-05-15 13:00:29 -07:00
jenkins-bot
9e14eae8bc Merge "Removed unused join array from ActiveUser conds." 2013-05-10 15:14:43 +00:00
Aaron Schulz
390c515c8d Removed unused join array from ActiveUser conds.
* The table was not in the table array so this did not affect
  the SQL, but was still unused cruft.

Change-Id: Ia5aa934fb6e6de9daeb0072d902df6e681575fd7
2013-05-09 18:10:12 -07:00
umherirrender
c6894adefc Fixed spacing
Added spaces around some parenthesis

Change-Id: If1e50e2a7b0046e91c0bbce8bf6641d8b2446a1d
2013-05-09 19:48:10 +02:00
Aaron Schulz
d969b3353d Refactored Special:ActiveUsers queries to remove filesort/temp table.
Change-Id: I4f32bad5084aadd289ccd2eefd93fc3d0d585b11
2013-05-05 18:50:29 -07:00
Chad Horohoe
a6d2365015 Revert "Remove Special:ActiveUsers"
This reverts commit 27104686ab.

Revert "Remove link to Special:ActiveUsers from Special:Statistics"

This reverts commit 62949af09e.

I used a sledgehammer where a scalpel would've done--and I should
be whacked with the cluebat. This should be done per-wiki, plus
improvements.

Change-Id: Ib43b42057b8d9f714a8a71ba9cbe375385254b7c
2013-05-05 23:14:21 +00:00
Chad Horohoe
27104686ab Remove Special:ActiveUsers
This feature was poorly thought out from the start. It's a huge
performance drain when used, for a mimimally useful set of data

Change-Id: I138622e1c184f74e2a7ce13a9a544ab4e610d7a0
2013-03-25 18:19:21 -04:00
Aaron Schulz
8128301175 Removed user table JOIN from ActiveUsers query.
Change-Id: I2d6d2154a277d256db09e2a851424ba026862be9
2013-03-15 05:34:34 +00:00