Commit graph

33 commits

Author SHA1 Message Date
James D. Forrester 60a0218a1a build: Update MediaWiki requirement to 1.42
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I57fbf5626575b7f1d7df67f6aecbb99d04504210
2024-01-12 14:12:07 -05:00
Tim Starling 6f32dafbc1 Use the new DatabaseVirtualDomains feature
Change-Id: I05b6361bd57ba6754bd308e04da1c635f95d042b
2023-10-26 14:50:22 +11:00
Tim Starling 534e3ce4b3 LoginNotify seen subnets table
Add a table which stores a summary of each user's IP address subnet in
each time bucket, defaulting to 15 days. On edit (and other changes
causing a recentchanges row) and successful login update the table.

On attempted login, check whether the subnet is in the table in any
time bucket back to the expiry time.

Add a job and a maintenance script for purging expired rows.

Disabled by default for now. The idea is to enable it by default after
we have some experience with using it in WMF production.

If CheckUser integration is disabled (the future intended state), the
cache and LoginNotifyChecks job are suppressed since they are
unnecessary.

Details:

* Rename setCurrentAddressAsKnown() to recordKnownWithCookie() and
  split off recordKnown() which does the same thing except without
  sending the cookie. We use recordKnown() to store the IP address
  without sending the cookie, on non-login changes.
* Reorganise isKnownSystemFast() for clarity, and return emphatic
  USER_NOT_KNOWN if the user is not in the table, cache or cookie
  and CheckUser integration is disabled.
* Replace time() calls with a mockable method.

Bug: T345052
Change-Id: Iea716e660353f16c47f873fe42edc2aeec1b4346
2023-09-04 15:04:36 +10:00
Tim Starling 4c369696cc ServiceWiring, dependency injection
* Make LoginNotify into a service. Use a static getInstance() method
  instead of a services container class, since there is only one
  service.
* Removed references to $wgLoginNotifyEnableForPriv. The feature was
  removed in I888c6009fffad1712.

Change-Id: I9120b470d27a0d09e508bd4e12eb2bde2f38d34d
2023-09-04 15:04:36 +10:00
Tim Starling a47af7c73d Fix deprecations and non-static providers
Change-Id: Ia267a93a13191a2289aff70d47c31b2afcb1647b
2023-08-25 15:10:07 +10:00
James D. Forrester 7b6daae158 build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I9941a4f13c1ac7093bc136b611e8a618dbc8920d
2023-08-19 13:29:57 +08:00
Umherirrender 4edd893fcc Use HookHandlers for Echo hook
Bug: T344297
Depends-On: Iffa2b409502b4269c9746e0304feb4aaee37a86e
Change-Id: I38fd96f2c4a5913b89d5dd760efb68273cb344a1
2023-08-16 00:59:03 +02:00
Umherirrender f02ff3ab36 Use HookHandlers for core hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T344297
Change-Id: Icfa49dc56848c9b375f09d67ed839d0e10f57bfb
2023-08-16 00:34:21 +02:00
gerritbot 0ecf7ee302 Update moved class WikiMap
See T321882. Moved in I60cf4b9ef02b9d5

Bug: T321681
Change-Id: I1fdefa8f3eee67758a59d36a38209b1e418d9281
2023-04-25 09:54:12 +00:00
Alexander Vorwerk 6be5c9599b Use namespaced CentralAuthUser
Bug: T298840
Change-Id: Ib2eef3aaec85d8b9397ece6d1c9ff583b54d39c3
2022-01-09 13:56:23 +01:00
Reedy 68b1b460d6 Make use of BatchRowIterator::setCaller
Bug: T261014
Change-Id: I803145598f8690e6f054defdc8361cc07a08d2e8
2020-09-04 18:30:20 +01:00
DannyS712 ff9ae6b7e3 extension.json - don't use array syntax when hooks only have 1 handler
Change-Id: I88ae489a644dd0cb11f4c3b3a9963a93e286a8a4
2020-03-11 09:52:55 +00:00
Ammar Abdulhamid f79c19acca Replace deprecated IP class with IPUtils
* Bump required MW version to 1.35.0

Bug: T242556
Change-Id: Ia25b7b6f8bc49e4b3d77f9f755b796f09a9aebaf
2020-02-09 07:36:57 +01:00
Reedy eb30d41804 Update to manifest_verson 2 in extension.json
Bug: T200480
Change-Id: Iea86a1db0871f04a968c67f2cda2be7dfefe4b3c
2018-07-27 01:31:21 +01:00
Max Semenik 80f92c289e Switch to PSR-4 autoloader
Change-Id: I8faf03f477bd59ab893c045a416a772a2fadfd91
2017-12-14 23:07:00 +03:00
Max Semenik ee5ae41740 Remove compatibility with pre-1.27 MediaWiki
Change-Id: I3f7fd7b11d5f710ae4e940bdddd7001aa6948cf3
2017-10-25 18:26:57 -07:00
Max Semenik e13be59e42 Remove support for per-group preference defaults
Not used and introduces serious compexity, likely causing
the bug with users receiving notifications they've opted out of.

Bug: T174220
Change-Id: I888c6009fffad17121765678387022ed7d454cb0
2017-10-13 17:12:20 -07:00
Niharika Kohli a72559d074 Make LoginNotify email notifications on by default
Bug: T174263
Change-Id: Idd086904a419ac2ba65707b5c90ceae5e79c35ec
2017-09-15 13:26:01 -07:00
Max Semenik 0a70efc9da Move expensive processing into job queue
Bug: T167731
Depends-On: I618840fafd22d9b6471eb470ef0414e354aa17f5

Change-Id: I1fcd15f523828141e8fadee9a8ad824eacefc0f9
2017-07-11 22:08:53 +00:00
Max Semenik 9b3bd403ec Cleanup: namespace this extension, move stuff into includes
Change-Id: I7cf55685de955912c8637681c397179553d17152
2017-06-16 04:15:12 +00:00
Ricordisamoa effdee71f3 Fix some typos
The names of two private methods have been changed.

Change-Id: I966930bdf44190c3b5262ddaf13b9ed46a478735
2017-05-13 13:17:41 +02:00
niharika29 7416910367 Update documentation for "LoginNotifyEnableForPriv"
Bug:T160094
Change-Id: I96ac5961ce220640b4a8028f270964f5e5f1527b
2017-04-28 16:27:36 -07:00
niharika29 08479c9f47 Change default configs for LoginNotify production
Bug: T160094
Change-Id: Ibb19e2569d3b3f86dfdeffb3f803cae677e7ee59
2017-04-24 22:43:41 +00:00
niharika29 d7f69cbab0 Bundle notifications and show a single header message
Bug: T162104
Change-Id: I6056098de7947dc450efdbbce6e42638bec4e2fd
2017-04-13 21:59:41 +00:00
MusikAnimal 0a4cd510e4 Complete documentation of config variables
Bug: T160094
Change-Id: Icf312685419fb314943ef7b978caf6707724e838
2017-03-24 17:48:20 +00:00
niharika29 4fae81abed Update AddNewAccount->LocalUserCreated hook for LoginNotify
Bug: T135270
Change-Id: I0efbacac13807d802e5cc6e4d226d75050f01d2d
2017-02-23 17:47:03 +00:00
Florian Schmidt 3a1a488b23 Use ExtensionRegistry to check, if Echo is installed
Instead of checking, if an internal class exists, it's more
accurate to require an extension and Extensionregistry will
check, if the requirements are fulfilled. If not, it will throw
and exception.

Depends-On: I2bde10ed08048bc0164446dd59d0d4575870fa54
Change-Id: I85a84988c75290d7df63dec27b69b250e305c896
2017-02-05 11:03:19 +00:00
niharika29 03839f7d96 Remove EchoBasicFormatter - no longer in use
Cleanup LoginNotify

Bug: T151414
Change-Id: Idc8913ebd80418dc40fb97d0a92fb51de5b07abf
2017-02-01 03:34:42 +00:00
Umherirrender 637cd2da5f Avoid duplicate @doc in extension.json
External JSON reader can have problems with duplicate keys in json.

Change-Id: I80c18a77ceafef681708f7656db465fb3717e0c0
2016-12-17 00:48:15 +01:00
Kunal Mehta f58cec3a69 Move tests to tests/phpunit/ and remove hook
The UnitTestsList hook is no longer needed as tests are now
autodiscovered.

Bug: T142120
Change-Id: Ie4abce0cac28c408ed9ba5f4327912a3ca0c2925
2016-08-06 01:30:11 -07:00
Brian Wolff 143d7caa44 Update LoginNotify for AuthManager.
I left the old hook in place for back-compatibility

Bug: T135270
Change-Id: I5800c7de902718958cd4a8edb33cbffd93dd827d
2016-07-07 15:02:11 -04:00
Brian Wolff 8fa1401235 Follow-up fea1a38d - respond to Legoktm's comments
Also make a minor change to the default config options.

Change-Id: Icf295c50b6f834ec004c73213935679e409b65c5
2016-04-26 12:53:38 -04:00
Brian Wolff fea1a38de5 Initial version of extension to notify people on failed login attempts.
Bug: T11838
Change-Id: Id96aff70f06879a7b754b19af8e65c0f641e84e0
2016-03-28 04:29:04 -04:00