Commit graph

51 commits

Author SHA1 Message Date
Kosta Harlan 10b9276855
Allow showing a CAPTCHA in response to AbuseFilter consequence
Why:

- We want to allow administrators to invoke a CAPTCHA
  if an AbuseFilter is configured to do so.

What:

- Implement the AbuseFilterCustomActions hook and define
  CaptchaConsequence, which will inform AbuseFilter's implementation
  of onConfirmEditTriggersCaptcha that it should show a CAPTCHA
- Deliberately do not register the "showcaptcha" action as a "dangerous
  action", because filters that use this action are aimed at bot
  traffic, and we don't want a bot to be able to get past the
  "showcaptcha" action just by making repeat requests

Soft depends on I110a5f5321649dcf85993a0c209ab70b9886057c

Bug: T20110
Change-Id: Ie87e3d850541c7dc44aaeb6b30489a32a0c8cc60
2024-05-12 16:16:11 +02:00
Fomafix efe5dd0cfb Inject service MainWANObjectCache into Hooks
Change-Id: Ib6561efa67e61b5a5cf93b284e36fcf3f49c603b
2024-04-26 20:49:06 +00:00
Gergő Tisza b52d63ee9d Revert "Drop various class aliases"
This reverts commit 3798d424e2.

Bug: T355198
Change-Id: I99ecee703cdfa06198eeede96e6c3bdda2d457e0
2024-01-17 04:46:58 +00:00
Reedy 3798d424e2 Drop various class aliases
Move manual wgAutoloadClasses entries into TestAutoloadClasses

Change-Id: I4c85a2042ae591732b48bbf872277909a90675b4
2024-01-16 10:49:21 +00:00
James D. Forrester 96f458cdd6 */extension.json: Drop RL targets definitions, no longer honoured
Bug: T328497
Change-Id: Id8501de1d372b7eca8e49c669d401322b2a51371
2024-01-12 22:33:04 +00:00
James D. Forrester c171047dcb build: Update MediaWiki requirement to 1.42
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: Ia86fec849d2bcf7df66ae18bdf84b902524cec75
2024-01-12 14:10:15 -05:00
James D. Forrester a076a9a1b9 build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: Ide89bc54b05421247539679d9a2c2e3735e8defa
2023-08-19 13:12:05 +08:00
Umherirrender 0b0f9e37af Use HookHandlers for core hooks
Bug: T269882
Change-Id: I91df459f696e99bb5cce597739b48cbebbf4a88e
2023-08-15 12:21:21 +02:00
Amir Sarabadani 70a398c036 Use core's externallinks lookup
Depends-On: I8ae9ef388957b0c04efa281f3bc3b5796bec17fe
Bug: T326251
Change-Id: Ibb0f01bdb7a7286389732d45ed0177ca4dfbf2a5
2023-04-24 19:55:10 +02:00
Umherirrender 65d54c1a27 Replace deprecated HTMLForm::addFooterText
Bug: T325474
Change-Id: I32197ab82558b6aba9b535614f129dc06b51d0eb
2022-12-27 12:48:17 +01:00
Reedy a0feac27b0 Namespace captchas
Change-Id: I2933639f9cb50db2101c4765ce9d8f9069d253b8
2022-12-13 21:40:30 +00:00
Reedy 30cd1d8a23 Namespace base classes
Change-Id: I3fa9747e0ea970c5de39e2da8603e1bba9388a69
2022-07-30 18:13:03 +00:00
Alexander Vorwerk 607452ef05 Add new ConfirmEditTriggersCaptchaHook
This allows the dynamic activation of CAPTCHAS triggering without the
need to change the configuration.

This lays the foundation for stewards to later be able to activate
'emergency captchas' via an on-wiki interface.

Bug: T303433
Change-Id: If48689fe068aa3ec56e51e01b84cf25c63bcbf0b
2022-06-30 18:59:45 +00:00
vladshapik 824ef272dd Replace uses of the deprecated setters of AbstractAuthenticationProvider
Since AbstractAuthenticationProvider ::setLogger, ::setManager,
::setConfig, ::setHookContainer methods had been soft deprecated,
so its usages were removed. AuthenticationProviderTestTrait
::initProvider was used in order to initialize
CaptchaPreAuthenticationProvider in the test.
* Also bump required MW version to 1.37.0

Bug: T281993
Change-Id: I9a139433b089597a2a5dfb7e23338fc8f7183b47
2021-05-25 15:34:56 +00:00
Reedy 29709a61b7 Move some classes to TestAutoloadClasses
Change-Id: Iafbdb1e66dd42ff57c0f80e274e83ccadbad77a0
2021-04-04 00:18:57 +00:00
James D. Forrester 4e62a8f53e Update ConfirmEdit hook running to use HookContainer, partially
I've left alone the pass-through hooks into the sub-extensions for now.
That'll be the next patch

Bug: T269882
Change-Id: I62eedd4afc36b4610a138b84b02d2cc48ce0ae2f
2020-12-13 08:52:18 -08:00
DannyS712 21ec725c5a Update hooks to use PageSaveComplete
Extension requires MW 1.35+, always available

Bug: T250566
Change-Id: I43d76880557dd794540147503c7c94091c7b847a
2020-06-23 19:36:44 +00:00
Bartosz Dziewoński f786536715 Extract CaptchaInputWidget from VE code for use in other extensions
* ext.confirmEdit.CaptchaInputWidget.js:
  Based on code from ve.init.mw.CaptchaSaveErrorHandler.js

* ext.confirmEdit.CaptchaInputWidget.less:
  Based on code from mw/ext/VE repo in ve.ui.MWSaveDialog.css

* ConfirmEditHooks.php:
  Based on code from mw/ext/VE repo in VisualEditorHooks.php

Change-Id: I6605017fd31a4f96c529dd0beb69e9f4433cebc1
2020-04-15 16:06:58 +02:00
JJMC89 233924604f Add skipcaptcha to the basic grant
Bug: T241118
Change-Id: I6c17fff97d868090cf9f770d2dd66c089154eae2
2020-03-21 20:51:11 +00:00
Ammar Abdulhamid 07a2824630 Replace deprecated IP class with IP Utilities
* Also bump required MW version to 1.35.0

Bug: T242556
Change-Id: I279e7d83a0dc75414117208ed23f8cc6b729eb19
2020-02-09 08:23:02 +01:00
James D. Forrester c933d06904 Update extension.json files to use manifest_version 2
Bug: T234114
Change-Id: I9b22aed290fc5c51b2c9bff34466d57e2c65148d
2020-01-19 16:35:49 +00:00
James D. Forrester d0d036ea50 Drop use of wgParser, replaced in 1.32 and to be removed in 1.35
Bug: T160811
Change-Id: I6147fc4aa6d004cd848c170750a740091c336012
2019-10-28 20:12:00 +00:00
Amir Aharoni a42d5d4adf Move apihelp messages to a separate file
This is one of the last extensions to be converted to having
the API messages in a separate file (at least out of the extensions
that are used be Wikimedia).

This one is a bit different from the others because it actually as several
extensions with separate i18n files, so it requires extra-careful review,
especially in Gruntfile and the extension.json files.

Bug: T189982
Change-Id: I66faae6fd4ff447327587c89ad2a1704edd1b356
2019-08-31 22:52:29 +03:00
Florian fe6d078b9f [recaptcha] Remove the ReCaptcha module
It's not supported by Google for a while.

Bug: T223749
Change-Id: I159cdd4882c1de48d6cee359faa153a2e6e0424b
2019-06-22 10:38:39 +01:00
Bartosz Dziewoński 8f9215deb9 Add mobile target to VE plugin modules
Bug: T213774
Change-Id: I99242bda4e09fec2dfabb2695bf82064cfc48fd7
2019-01-15 01:05:29 +01:00
Ed Sanders 423234cb77 Convert SimpleCaptcha to OOUI
Change-Id: Ic904b53b2ac489be572f4b6096ddc8c92c482a59
2018-12-12 11:51:38 +00:00
Ed Sanders 057db3d77a VE: Convert to SaveErrorHandler
Change-Id: I18386a72146e1179c8656e3c9c01a256ec2096d6
Depends-On: I036ee32847cc3b25a1cc478247cfe54599781098
2018-11-29 16:52:41 +00:00
Ed Sanders 1f0d203065 Move VE's ConfirmEdit support to this extension
This can be merged before the code is dropped from VE, as
it will just overwrite the registry entry.

Bug: T141676
Depends-On: I2c35b9443208928db43bcfd515864641b10cc602
Change-Id: I2fa7ca7203e0a82f5ce9b79e2642dba2baba6c5a
2018-11-23 17:24:56 +00:00
Max Semenik 5b7a36a521 Clean up some phpcs problems
Change-Id: Ie956fe86184535a376d0398483ac3c853fa9127c
2018-07-12 23:13:58 +00:00
C. Scott Ananian bcc9f5a9e2 Replace uses of deprecated Language::truncate()
See I2291c69d9df17c1a9e4ab1b7d4cbc73bc51d3ebb for the anticipated
hard-deprecation of this method in core.

Bug: T197492
Change-Id: I08b5c7b0c8cc1b88f07163cfd412e5d7e87c56f3
2018-06-16 09:24:51 -04:00
zoranzoki21 7e78e7ccaa Removed deprecated position statements from resource loader module
Bug: T184257
Change-Id: I06e877cc7e28553c46a669970bfc64a55e386f0c
2018-02-04 09:05:40 +00:00
Kunal Mehta 78cb14cf1e Use SPDX 3.0 license identifier
SPDX released version 3 of their license list (<https://spdx.org/licenses/>),
which changed the FSF licenses to explicitly end in -only or -or-later
instead of relying on an easy to miss + symbol.

Bug: T183858
Change-Id: Ifa6b2480400a161fd931a4ab456c0dcaa809459e
2018-01-04 02:57:05 -08:00
Umherirrender 8a3c51b1db Move classes to own files
Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I88b5112d84d8983e67be1bca9f4039486bcefc6f
2017-12-16 13:32:46 +01:00
Florian Schmidt 50bc57a200 Allow other extensions to setup triggers using attributes
Instead of misusing the config section of extension.json to declare
captcha triggers in the ConfirmEdits CaptchaTriggers config variable,
other extensions can now use the CaptchaTriggers attribute for the
exact same thing. E.g., to declare a new trigger, the following
addition to the own extension.json will register the trigger in
ConfirmEdit:

  "CaptchaTriggers": {
    "wikiforum": true
  }

This also removes the CaptchaClass config from the main extension.json
config section, and automatically sets the SimpleCaptcha module in the
getInstance() method of ConfirmEditHooks, which is a pre-requirement for
the mediawiki/core change Ieeb26011e42c741041d2c3252238ca0823b99eb4.

Bug: T152929
Change-Id: I4c5eaf87657f5dc07787480a2f1a56a1db8c714f
2017-09-02 17:45:26 +02:00
Florian Schmidt 37f2dcfd23 Rename $ceAllowConfirmedEmail to $wgAllowConfirmedEmail
The value of $ceAllowConfirmedEmail is copied to $wgAllowConfirmedEmail if
set in LocalSettings.php for backward-compatibility. However, a deprecation
warning is emitted in this case.

Bug: T162641
Change-Id: If4daf6f25f0d2b2c0f1e173ee3903063a39978bb
2017-04-17 19:26:37 +02:00
Reedy f906d4df1f require -> requires in extension.json
Follows up I72fa5e3f68c0c3de3f3ddae2fb16ba5fad6a67b2

Change-Id: I9010f1c0745082d328633091403792e58e9b8386
2017-02-20 18:17:24 +00:00
Reedy 55949565bb Remove pre-AuthManager support
Bump version to match

Fixup some whitespace. Fixup some function level documentation

Change-Id: I72fa5e3f68c0c3de3f3ddae2fb16ba5fad6a67b2
2017-02-17 13:26:46 +00:00
Reedy a2fc069174 Use an accurate number of captchas
Change-Id: Ice434235687aa68ccf37a0219d379beb97e5a8ec
2017-02-08 18:05:49 +00:00
Brad Jorsch ac97e69999 Remove pre-1.25 API compatibility code
Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: I31b96b0939d5321be31889422cfc703c9c6c2baa
2016-09-20 15:32:05 -04:00
jenkins-bot 77d3872753 Merge "extension.json: 1st dimension is namespace ID, so avoid re-numbering" 2016-08-29 17:23:24 +00:00
Matthew Flaschen 9a3e0f5035 extension.json: 1st dimension is namespace ID, so avoid re-numbering
Use array_plus_2d so namespace IDs don't get re-numbered.

Bug: T143516
Change-Id: I3e078ec0a1c0e595b1d5b65b5ece6fa9cb8ab5bb
2016-08-25 21:21:34 -04:00
Florian 1163b6f100 Replace the edit preview with a validation of whitelisted IP addresses
The user now can press the preview button to bring up an interpreted list
of the lines of the interface message MediaWiki:Captcha-ip-whitelist to check
if the added/remained data is (still) a valid list of (whitelisted) IP addresses.

Bug: T129757
Change-Id: Ic61f00e7f88c9290ae6e11f7258c11a730ac98c8
2016-08-21 18:54:41 +02:00
Florian Schmidt f1177dbc47 Use string for Hooks in extension.json, instead of arrays
This is a lot easier to read.

Change-Id: Iab783a120cf600c22143016e6ebaa18ef12e7c70
2016-08-18 20:10:59 +02:00
Florian Schmidt fc71c869e1 Use TitleReadWhitelist for automatic whitelist
Instead of abusing the extension.json callback.

Bug: T142259
Change-Id: I12501ebfa61a4b2f72cec1f94b86a54e56c28719
2016-08-18 20:08:51 +02:00
Reedy 6a8c53f6d1 Remove 'UnitTestList' hook
No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Bug: T142121
Change-Id: I7105170e56c8c3ec3837dd15be869e503bccecde
2016-08-05 18:46:15 +01:00
Bartosz Dziewoński 5c9e5cfccd Remove backwards-compatibility code using APIEditBeforeSave hook
It was only needed for MediaWiki prior to 1.25
(09a5febb7b024c0b6585141bb05cba13a642f3eb).
We no longer support those versions after
1d08dd07b8.

Bug: T137832
Change-Id: I27f244631e9dcd160bffff70349e5034f2a537ea
2016-06-16 17:54:54 +02:00
Gergő Tisza 31c59374a4 Add AuthManager support to SimpleCaptcha, QuestyCaptcha, FancyCaptcha, MathCaptcha
Also update MathCaptcha so that it works with recent versions of
Math (and breaks with old ones). Also fix MathCaptcha API output,
which used to send the question in plaintext.

Bug: T110302
Change-Id: I0da671a546700110d789b79a3089460abd9cce3b
Depends-On: I8b52ec8ddf494f23941807638f149f15b5e46b0c
2016-05-16 09:50:25 +00:00
Glaisher d0adbc8f0f Allow IP whitelist to be modified on wiki
Local administrators can now use [[MediaWiki:Captcha-ip-whitelist]]
page to exempt specific IP addresses and IP ranges from captchas.
This is useful for modifying in a short notice such as editathons and
other events like this where captchas add unnecessary complexity for
new users.

The page is disabled by default and IPs should be added separated by
newlines. If any other character is found on a line, it will be ignored
but leading and trailing whitespace characters are allowed.

Bug: T103122
Change-Id: I54866b5bfca80debcf3d3fb7963932ed03b48548
2016-03-12 14:17:23 +05:00
Brian Wolff 01f565863f Show captcha if a specific user account has many failed login attempts
Use a default setting of > 20 logins in 10 minutes. In order to
achieve this many with core's default throttle's, you would have
to be attempting to login from at least 2 IP addresses.

Bug: T122164
Change-Id: Id3ea766cfb7d50444082275a628b8b2aa10e6050
2016-03-03 12:44:15 -05:00
Florian eb36aed916 Add AUTHORS file and update authors for Special:Version
The list of authors was generated with:
git log --all --format='%cN <%cE>' | sort -u

I removed duplicate entries (mostly users.mediawiki.org addresses).

Extra points:
 * Added composer.lock to gitignore

Change-Id: If3e5d3e6dada06b7230d1746932dd5bce88993e7
2015-12-06 14:21:07 +01:00