Commit graph

5 commits

Author SHA1 Message Date
Daimona Eaytoy
ab03e700a6 Add a temporary method for setting visibility of the block log entry
As per description on phabricator, BlockUser::log() creates a log entry
and inserts it, without offering callers any way to alter it. In particular,
it is not possible to alter visibility of the entry, which already has
at least a use case (T152394).

This method is @unstable because there haven't been enough public discussion
about it. It might then become @stable or be replaced by something else (e.g.
a constructor option or a hook), at the discretion of the maintainers
of this code (viz. AHT).

Bug: T271101
Change-Id: I4ed0c828da9c79de615fd8a88e99200fe9183fad
2021-02-08 16:18:54 +00:00
Umherirrender
8a78262006 Use ConvertibleTimestamp::time in BlockUser::parseExpiryInput
To use fake times in tests

Bug: T272236
Change-Id: I1357d3a78538b8bcb2a3507d86f35371e3f26d47
2021-02-05 22:42:52 +01:00
Martin Urbanec
b5ef266181 Do not call SpecialBlock from BlockUser
Bug: T263189
Change-Id: If7c0a5929826265045ebba3c19663ec19d3dfc0b
2020-10-04 23:20:06 +02:00
DannyS712
dbc07d39db BlockUser: Avoid getUserPage() on string
Bug: T189073
Change-Id: I0ce8a1527126c753d1fe5f6c2903a42d7d13ca71
2020-09-25 17:01:29 +00:00
Martin Urbanec
a656d03597 Introduce backend class for blocking users
Rather than having to do DatabaseBlock calls directly,
and then ManualLogEntry calls to facilitate logging,
let's create a BlockUser service, capable of blocking users
and logging, optionally with permission checking.

This should make blocking users easier for developers,
for instance, AbuseFilter or CheckUser can easily
benefit from this commit.

Bug: T189073
Change-Id: Ifdced735b694b85116cb0e43dadbfa8e4cdb8cab
2020-09-22 14:14:01 +01:00