Commit graph

819 commits

Author SHA1 Message Date
jenkins-bot
06457facaa Merge "Clean up NewFilesPager: remove deprecated and unused services" 2021-05-27 17:23:27 +00:00
jenkins-bot
236018d5e3 Merge "Replace RecentChange::getPerformer with RecentChange::getPerformerIdentity" 2021-05-27 14:02:54 +00:00
Petr Pchelko
4e75536609 Clean up NewFilesPager: remove deprecated and unused services
Change-Id: I682b15769f31da7e7a1a6c08b45c1a2305556f2f
2021-05-27 13:47:22 +00:00
Roman Stolar
dbe594a3ce Replace RecentChange::getPerformer with RecentChange::getPerformerIdentity
Preparing replace in core (DifferenceEngine.php, Article.php, ChangesListSpecialPage.php)

Bug: T276412
Change-Id: I4fd9cbd9404879d082179b68a9993e7203e43a8d
2021-05-27 11:45:17 +03:00
jenkins-bot
a2ef517228 Merge "SpecialCreateAccount: don't reinvent the wheel for restrictions" 2021-05-27 02:05:25 +00:00
DannyS712
efed250126 SpecialCreateAccount: don't reinvent the wheel for restrictions
Add restriction support to LoginSignupSpecialPage::__construct,
and set mRestriction to 'createaccount', removes the need to
inject a PermissionManager

Change-Id: Ifd7d6e687a3c78d300cc612526458afb6934a4c0
2021-05-26 22:19:21 +00:00
Petr Pchelko
e86cfe1592 Remove deprecated SpecialPage::getRestrictedPages
Change-Id: Id3181a46e17043f6f21200e34727a7ff627e7f16
2021-05-26 13:44:58 -07:00
jenkins-bot
be5631743e Merge "WikiImporter: inject services" 2021-05-26 16:45:59 +00:00
DannyS712
f057d2253c Replace deprecated uses of PermissionManager with GroupPermissionsLookup
In a few places where a PermissionManager is used
but only GroupPermissionsLookup is needed

Also update references to the class in PermissionManager
that referred to it as GroupPermissionLookup

Change-Id: I5d7a13900852a38768a106aeee1ce012c3a04ea2
2021-05-26 05:47:21 +00:00
ZabeMath
3c978f6fc6 WikiImporter: inject services
This patch injects services into WikiImporter. It also adds
a WikiImporterFactory service for creating WikiImporter
instances.

Change-Id: I2966297e5728fca1ae8280361f1008cef6c6041b
2021-05-24 23:10:07 +02:00
Thiemo Kreuz
ac47a1a9af Don't use NamespaceInfo when it's not necessary
Change-Id: Ia568a7d3493ea3f23e58a991dbdbef10ad34fcdb
2021-05-17 07:06:58 +00:00
Tim Starling
8327d2f0ca Fix changes list "hide myself" feature
Broken by fd01c53778

Bug: T282183
Change-Id: I0ae68702f9ea160a1e649ca6c52f88cdf9a8e8e5
2021-05-12 09:45:59 +10:00
jenkins-bot
028fa9659b Merge "Remove uses and hard deprecate wfCanIPUseHTTPS" 2021-05-03 03:18:24 +00:00
jenkins-bot
644153cf39 Merge "Add action block to BlockList" 2021-04-30 19:24:53 +00:00
DannyS712
5e5b5b196b Remove uses and hard deprecate wfCanIPUseHTTPS
Bug: T281598
Change-Id: I4685674921eb68f8fb540607d88d07416749bc1c
Depends-on: Ic86d68d5b328e84cdb6a0cc9f1b6adfd2ac0a604
2021-04-30 19:09:20 +00:00
AnaïsGueyte
2a1baa8848 Add action block to BlockList
Add action blocks on Special:BlockList

Bug: T279559
Change-Id: I42d541270ca8b84b3c0469353708d94944f75f18
2021-04-29 13:33:18 -07:00
James D. Forrester
df5eb22f83 Replace uses of DB_MASTER with DB_PRIMARY
Just an auto-replace from codesniffer for now.

Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
2021-04-29 09:24:31 -07:00
Tim Starling
44c76b8d9f Stop using legacy ActionMigration field "ipb_by"
Bug: T278917
Change-Id: I392b0bf23f23a2ca08664e4b49c9eeb26df348de
2021-04-28 16:29:04 +10:00
Tim Starling
83e184670c Stop using legacy ActorMigration field "log_user"
Bug: T278917
Change-Id: I1b78bad7e1fa43f5f82908567a7daad9c6cc79b9
2021-04-28 16:29:04 +10:00
Tim Starling
fd01c53778 Stop using legacy ActorMigration field "rc_user"
Bug: T278917
Change-Id: I4d6c175c637a2cb26c63e0b2b27d5ea8ce6b1e0d
2021-04-28 16:29:04 +10:00
jenkins-bot
a8196f5904 Merge "Introduce infrastructure for partial blocks for actions" 2021-04-27 23:57:33 +00:00
Thalia
c67f181dd4 Introduce infrastructure for partial blocks for actions
This adds a new type of block restriction for actions, which extends
AbstractRestriction. Like page and namespace restrictions, action
restrictions are stored in the ipblocks_restrictions table.

Blockable actions are defined in a BlockActionInfo service, with a
method for getting all the blockable actions, getAllBlockActions.

Action blocks are checked for in PermissionManager::checkUserBlock
using DatabaseBlock::appliesToRight. To make this work, this patch
also removes the 'edit' case from AbstractBlock::appliesToRight,
which always returned true. This was incorrect, as blocks do not
always apply to edit, so cases that called appliesToRight('edit')
were fixed before this commit. appliesToRight('edit') now returns
null (i.e. unsure), which is correct because it is not possible to
determine whether a block applies to editing a particular page
without knowing what that page is, and appliesToRight doesn't know
that page.

There are some flags on sitewide blocks that predate partial blocks,
which block particular actions: 'createaccount' and 'sendemail'.
These are still handled in AbstractBlock::appliesToRight, and are
still checked for separately in the peripheral components.

The feature flag $wgEnablePartialActionBlocks must set to true to
enable partial action blocks.

Bug: T279556
Bug: T6995
Change-Id: I17962bb7c4247a12c722e7bc6bcaf8c36efd8600
2021-04-27 21:53:13 +01:00
Petr Pchelko
1f9c3a4566 Move AuthManager::checkAccountCreatePermissions to Authority.
Change-Id: I8d223508ccec7122eef5e0bf136964ad65d64ab7
2021-04-26 14:14:43 -07:00
Tim Starling
a3b7ea6732 Stop using legacy ActorMigration fields img_user/oi_user/fa_user
Bug: T278917
Change-Id: If7dd7d2198bd79636fdfb8b5644fb7cd8ae2901f
2021-04-26 12:23:59 +10:00
jenkins-bot
3b0fc51124 Merge "specialpage: Remove redundant isListed() check, deprecate unused method" 2021-04-22 19:25:56 +00:00
jenkins-bot
3f131cb38e Merge "Delete cached data of non-cached querypages with updateSpecialPages.php" 2021-04-22 01:23:44 +00:00
Cindy Cicalese
63a29ba722 Use WatchlistManager in special classes
Change-Id: Ibe1ac90aa05db8f1018f59bb48da98e416b051c1
2021-04-21 04:40:57 +00:00
Tim Starling
419dde00f5 Stop using legacy ActorMigration field "ar_user"
Bug: T278917
Change-Id: Ib6bdb727d58a1732448a2034732269f2f125be7e
2021-04-20 12:44:29 +10:00
Timo Tijhof
c282c11794 specialpage: Remove redundant isListed() check, deprecate unused method
The getRestrictedPages() is completely unused in Codesearch, and I
can't think of a use case for wanting to list all but only pages
other people don't have access to.

Wanting to know this about any given page seems useful, but that is
what SpecialPage::isRestricted and ::userCanExecute are for.

Change-Id: Ie1d8796e793170beec516e8b1e4a3519c0e18890
2021-04-19 03:22:05 +01:00
daniel
f2f26a040c SpecialPageFactory: replace Title in method signatures
Bug: T279796
Change-Id: Ia08109735d31607a8c79bb748978c0c4e84f1f9e
2021-04-14 20:50:33 +00:00
jenkins-bot
28fbfbc910 Merge "Rename WatchlistNotificationManager to WatchlistManager" 2021-04-08 15:48:15 +00:00
Tim Starling
aa94551c2b Make SpecialFileDuplicateSearch not be a QueryPage
Since 2011, FileDuplicateSearch has been especially awkward as a
QueryPage subclass. The only thing of value in the parent was
construction of <ol></ol> tags, but that's not enough to justify it.
getQueryInfo() was unused  -- my motivation is to not have to maintain
it. A LoadBalancer was injected but was unused.

Change-Id: I2f0c18913260ee74ef266352bb93cfbdc1143d85
2021-04-08 14:39:01 +10:00
Cindy Cicalese
f1dadbb4ca Rename WatchlistNotificationManager to WatchlistManager
Change-Id: Ic9707c6b74180ef111d128f9f00de218d191c175
2021-04-07 18:16:24 -04:00
Ammarpad
798593cc73 QueryPage: Remove useless check
Change-Id: I676b26633103c10b1aa20646cbbe46e6450cc7cf
2021-03-29 17:57:01 +01:00
jenkins-bot
e98ae90c02 Merge "Avoid using User::getBoolOption()" 2021-03-28 02:18:21 +00:00
ZabeMath
60606a2986 Avoid using User::getBoolOption()
User::getBoolOption() is deprecated and should be replaced with UserOptionsLookup::getBoolOption()

Bug: T277600
Change-Id: Ife3c721237258d50852bbf764def74657cc70428
2021-03-27 22:51:03 +01:00
Umherirrender
a0716e80f8 Replace deprecated User::newFromName on Special:Mute
Change-Id: Idf48ce8718932f49344edf7520adccfcfb598d27
2021-03-22 21:27:54 +00:00
Bartosz Dziewoński
3881ccd8d6 Fix missing spacing before button on Special:CreateAccount
When extensions add fields with help messages to the signup form,
e.g. on https://wikitech.wikimedia.org/wiki/Special:CreateAccount,
there was no margin between the help message and the next field.

Remove a workaround for this problem from the password help message.
Follow-up to 1d82384bb5.

Change-Id: I07ad85d3b13697d360206d32b2861d1ee2a62132
2021-03-22 12:04:23 +00:00
jenkins-bot
ab85a9c9de Merge "Replace deprecated User::newFromName on Special:NewFiles" 2021-03-21 22:03:44 +00:00
jenkins-bot
02e18137f9 Merge "Replace deprecated User::newFromId on Special:Redirect" 2021-03-21 22:03:39 +00:00
Umherirrender
c2baed35db Replace deprecated User::newFromName on Special:NewPages
Change-Id: I858264faf4d3af03bfbbb2f73e7db3f8ff3bd145
2021-03-21 21:24:37 +00:00
Umherirrender
237ef2a624 Replace deprecated User::newFromId on Special:Redirect
Change-Id: I3a4f995e4cfb4dfe68b50662aebf795e3bb78b4a
2021-03-19 20:47:26 +00:00
Umherirrender
c0a90c3aaa Replace deprecated User::newFromName on Special:NewFiles
Change-Id: I1bd4ee23430b729af2ba9098815b30c167dc8532
2021-03-19 20:33:31 +01:00
Petr Pchelko
f984d3f83b Hard-deprecate AbstractBlock::parseTarget
Bug: T276610
Change-Id: I2f10ae5da1d9b1ca4aa20492b943e0c94d32a0b6
2021-03-19 07:22:48 -06:00
C. Scott Ananian
1fd4a7af4e Introduce Tidy service
Refactor the old MWTidy singleton as a DI service.

Change-Id: I95605ea5fd22f53a7f90fe07a6a73fa6c959597a
2021-03-15 17:22:36 -04:00
daniel
4dce6dd0c3 Deprecate UserIdentity::getActorId()
Note: User::getActorId() is not (yet) deprecated.

Bug: T274179
Change-Id: Ic2ca6d489db821fc2334e53bf2496c7b0d3ea5b1
2021-03-13 19:45:57 +01:00
Umherirrender
c11b87822f Delete cached data of non-cached querypages with updateSpecialPages.php
If a special page is no longer expensive (by code or by config like
DisableQueryPages) the data should not longer stored in the database,
because always fresh data are shown and never the cached data

This does not delete on disabled query pages, because the data still
visible on the page.
This only affectes query pages and not very special pages like
ActiveUsers

Bug: T174513
Change-Id: Ia9015cb7bc0ab7b1a3d96d1b481c31b3e6c39657
2021-03-10 20:28:09 +01:00
Petr Pchelko
bfa145fae7 Convert second batch of special pages to authority
Depends-On: Ifc82d29a00d3fd136c44e0699e6bbfa11b8cf2a6
Change-Id: Iaf559a72cc47ec5d2481d7f740ad0eb303c94002
2021-03-04 15:37:59 -07:00
Petr Pchelko
f415c95f6b Introduce SpecialPage::getAuthority shortcut to context
Change-Id: I6f856e830ffd47a119e9e184da89121c825d8973
2021-03-02 16:59:56 -07:00
Petr Pchelko
5d39397de3 Convert first batch of special pages to Authority
Change-Id: I4c6877ef2b1f32610190c6de0f1bcaaa3c835fb0
2021-03-01 21:41:20 +00:00