Commit graph

92 commits

Author SHA1 Message Date
Matthias Mullie 2c449c3acc (bug 65805) Fix notice when creating new filter
Notice: Undefined index: af_throttled in
extensions/AbuseFilter/Views/AbuseFilterViewEdit.php on line 148

This assumes af_throttled to exist in $newRow, which comes
from AbuseFilterViewEdit::loadRequest, which in turn comes
from AbuseFilterViewEdit::loadFilterData, where no
af_throttled property is added to the newly created object.

Bug: 65805
Change-Id: I45ad0ea2cea242711b6109e67b99b71242ff57f6
2014-05-27 15:26:17 +02:00
Kunal Mehta 4deb2cc1be Use FormatJson instead of json_* functions
Change-Id: Ic4eccb13429d4081153b5deb550ac33bf2bd687d
2014-02-27 08:38:07 -08:00
tonythomas01 068c3c54c3 Increased the number of rows in AbuseFilter's Filter testing textarea
Changed the textarea size in AbuseFilter Notes text area
from 5 to 15 to match with the new Conditions text box.

Bug: 55365
Change-Id: I1da26166f28f31b2a18c1dca3709efc0728d45d6
2014-01-25 00:42:05 +05:30
Siebrand Mazeland b384fe8d8f Declare class properties, update docs
Based on static code analysis.

Change-Id: Ibafe33b6327ab72429ba961079af40039fb41cbf
2013-11-06 16:12:37 +00:00
kaldari 307b078ada Only allow throttling if object caching is enabled...
...otherwise it doesn't work.

This change add 2 checks for object caching, one for the filter
configuration interface, and one for the actual throttle checking.

Bug: 50894
Change-Id: I89ebcc6ff7d91d3a9ad8e744c0c4ff3e33e3b673
2013-10-31 14:59:26 -07:00
Simon Walker 3612f45b2b Remove trailing whitespace
Change-Id: I1d9c4e64d09eeb9470d85476e030a1590495fa52
2013-10-07 18:08:11 +01:00
Simon Walker 938d101711 Add links to abusefilter-edit-done
This adds a link to the diff of the edited filter, and a link to the filter
itself.

Bug: 52590
Change-Id: If741756ef398a61ae0fcd809eaee5a040ac8ca3d
2013-10-07 13:17:07 +01:00
Marius Hoch 5ed5230a49 Refactor AbuseFilterView::canEdit* functions
Don't use global state in here, centralize
the logic for global filters and avoid static
functions.

This also makes the UI for global filters nicer
in case the user can't edit them (as all fields
are disabled then).

Change-Id: Ica4e77536d315d8ef39a45666c6b8834315bee77
2013-08-26 19:57:00 +00:00
jenkins-bot 2e8fc6f751 Merge "Prevent custom warning messages for global rules" 2013-07-02 21:41:48 +00:00
Marius Hoch 013889c5ac Prevent custom warning messages for global rules
This prevents an abuse filter admin from setting a custom warning
message (which are references to a non-translated, local wiki page),
for global filters (which can be on any wiki in any language).

bug: 45164
Change-Id: If61716053b75f45e4b70f78d3809ddd02ac6d83e
2013-07-02 23:20:06 +02:00
Marius Hoch 8957c003ba Revert "Change AbuseFilter to use UserCache instead of user_text fields"
This reverts commit aaa256aa94.

Bug: 49918
Change-Id: I597cbc03e2ecc45cfcca632232d5bbb1ef7be9d8
2013-06-27 01:01:15 +02:00
Aaron Schulz 05b38eb613 Merge "Change AbuseFilter to use UserCache instead of user_text fields" 2013-04-09 22:00:51 +00:00
Alex Monk aaa256aa94 Change AbuseFilter to use UserCache instead of user_text fields
Change-Id: I51210ff91366a3a1610d34ca20e8966aaded89a0
2013-03-27 15:59:34 +00:00
shirayuki b460fa790f Adding trailing dot + comment for grep (24 messages)
Change-Id: I7b532028a2bdbed11f0dfe6cdf4eb4514671294c
2013-03-07 23:03:59 +09:00
CSteipp b8b799630b Merge "Properly integrate $wgAbuseFilterValidGroups" 2013-01-07 23:01:48 +00:00
Matthias Mullie 0c174aec42 Properly integrate $wgAbuseFilterValidGroups
The concept of different AbuseFilter groups had not properly been integrated, but should be now:
- The total number of matches is now group-specific
- .. Which will also fix the emergency shutdown calculations
- And a portion of incorrect code (involving $logged_local_filters) has been fixed (action != group)

Change-Id: I091199a9d74aee47dcb3d8942394a28e0ffd3234
2013-01-07 14:42:51 +01:00
Hoo man 25232efb24 Merge "Adding a Link back to Abuse filter management page Added the navigation bar Set page title to 'Editing Abuse filter'" 2013-01-06 20:59:59 +00:00
Adithya Parthasarathy 2128a52a9c Adding a Link back to Abuse filter management page
Added the navigation bar
Set page title to 'Editing Abuse filter'

Change-Id: Ic11846d43587c2241df0635aabf3b9b3fae4056d
2013-01-07 01:55:19 +05:30
Marius Hoch d307970e1e Fixed a PHP notice in Views/AbuseFilterViewEdit.php
Change-Id: I39a6a4b3063dd4c5b07b014940170442c2bbdbe7
2012-12-30 05:02:04 +01:00
Hoo man f10b8eaab5 Merge "Add Permission for Global-Rule Editing" 2012-12-28 01:29:39 +00:00
csteipp cc000576d7 Add Permission for Global-Rule Editing
Add a permission 'abusefilter-modify-global' which an administrator must
have to set global rules in the central database.

By default, this right is not associated with any group.

Change-Id: Ied92f7ffd90cb2d8eeb8f3f26b941edbb22b10d6
2012-12-28 02:27:08 +01:00
Hoo man 7950267f98 Merge "Run filter number through formatNum()" 2012-11-02 21:14:33 +00:00
Hoo man d2568a7d43 Merge "fix php notices" 2012-11-02 19:57:52 +00:00
raymond 3f1b73e5f4 Run filter number through formatNum()
Change-Id: If95bbae4af3d4c5a35ee02f1adadc4040ef36009
2012-10-26 20:27:08 +02:00
Matthias Mullie 1706ca0832 Bug 40672 - Abuse filter: Increase 5% limit to allow filtering for very short posts
This patchset will make it possible for other extensions to tap into abusefilter with a custom group, and set different tresholds per group.
See https://gerrit.wikimedia.org/r/#/c/29569/

Change-Id: I21d31bdf28e26f3c830652efc08a247db9f7a86c
2012-10-25 20:21:19 +02:00
Siebrand Mazeland 176227e721 Maintenance for AbuseFilter extension.
* Replace deprecated methods.
* Remove no longer needed function fnmatch().
* Remove superfluous newlines.
* Remove unused and redundant local variables and globals.
* Deglobalization.
* Update documentation.
* Fix incorrect return values or add FIXMEs when in doubt.
* Escape output in a few places where needed.
* Remove unneeded MEDIAWIKI constant checks.
* Fix various JSHint/JSLint issues.

Patch Set 11: Merged https://gerrit.wikimedia.org/r/24701 into
this one per Siebrand's request

Change-Id: I02ba4ce31b6aca5b7324114093f8ece143abc295
2012-10-09 22:26:45 +02:00
Matthias Mullie 457c38cc3a fix php notices
Change-Id: I44ec2181ac7f2aea775f17c162838d52524084f8
2012-09-27 12:15:22 +02:00
grunny 13bdc746ed Add missing message from the edit view for global filters
This message is used on the edit view when global filters are enabled to specify
whether or not a filter is global.

Patch Set 2: Add comments on where the message is used along with other messages
that can be formed by the concatenated string so they are easier to find

Change-Id: I5d1e99fa1dcaea8ed298affbd6388042f58686ee
2012-09-04 19:13:02 +10:00
csteipp 1973ea6714 Add Global Rules
* Update rules list view to show global rules toggle, global rules
* Update rule processing to get global rules from memcache, if no
rule exists, get them from the central database and store them in
memcache
* Delete global rule key whenever global rules are updated
* Add filtering for log by wiki on the central database, updated
table definitions to add index on afl_wiki
* Add global $wgAbuseFilterDisallowGlobalLocalBlocks so local wikis
can prevent global rules from locally blocking, removing or revoking
permissions.

* patchset 13: Include recommendations from Tim. Add db updates to
LoadExtensionSchemaUpdates hook.
* patchset 14: forgot to add new files

Change-Id: Id69a9d603f9679f838e8691c651a3e9d8461b422
2012-08-27 03:30:07 +00:00
Liangent 1b7994b3bd Use a new message for subtitle of edit view when creating filter
Change-Id: Ie956ce2954e8f2507191677561fe68b548eddba5
2012-07-02 01:43:47 +08:00
Andrew Garrett 18bac6fed9 AbuseFilter: Make it possible to have differing default warning messages for differing filter groups.
Includes JS to sneakily change the default message if the user changes the filter group without having selected the "warn" action yet.

Change-Id: Ic753c3e018321dba3bf9f6d7bcee10a49c9faac8
2012-06-26 21:56:30 +02:00
Andrew Garrett b8ef2830bb Add some documentation improvements to Views/AbuseFilterViewEdit.php
Change-Id: I1f6fa1ff32b6fb1d71f99b0d456972c4ecaed29c
2012-06-17 23:03:39 +02:00
Andrew Garrett dc207d0cbd Abuse Filter: Allow filters to be split into "groups" for the purposes of operating them on different types of input.
The purpose of this change is to allow AFTv5 developers to run a separate list of filters against article feedback actions without issues of cross-contamination and bumping up against the condition limit.

Change-Id: I758795f01eaf3ff56c5720d660cd989ef95764a7
2012-05-12 12:53:32 +10:00
Sam Reed 69e582dc17 More documentation stubs
Fix Html::inputLabel to Xml::inputLabel

Fix up some deprecated code

Change-Id: If6503b1794d89666206802591094949e5d715ac1
2012-03-26 16:03:23 +02:00
Roan Kattouw 6c4bd57043 Revert r111217 (unreviewed rev in AbuseFilter) and its dependencies r113585, r113587, r113588, r113589.
All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
2012-03-21 19:41:11 +00:00
Sam Reed 05a9d4d061 More documentation stubs
Fix Html::inputLabel to Xml::inputLabel

Fix up some deprecated code
2012-03-11 20:51:54 +00:00
Sam Reed 642200ea1c Add some more __METHOD__ 2012-02-29 15:36:10 +00:00
Andrew Garrett e2479d45da (bug 33392) Fix issue where users without permission to add restricted actions could nonetheless remove them. Patch by Nikola Kovacs, with modifications for code style. 2012-02-08 01:02:11 +00:00
Victor Vasiliev 0f89170b4e Fix a syntax error caused by using the same variable name for two different things. 2011-11-27 08:58:46 +00:00
John Du Hart 7cf809bb0e Changes from r103817 2011-11-22 16:08:18 +00:00
John Du Hart 274dcd06a2 Pass one of converting AbuseFilter to use ContextSource
The main AbuseFilter class still needs to be fixed up, but that's a bigger job and I'm out of time
2011-11-16 05:34:24 +00:00
Raimond Spekking 4e578cac93 Run some filter IDs through formatNum() for better l10n 2011-10-17 07:56:05 +00:00
John Du Hart b30697e94c Adds ResourceLoader support to AbuseFilter
Rewrote javascript to use jQuery
Added API modules to replace sajax_* calls
Solves bug 29714
2011-08-26 20:12:34 +00:00
Sam Reed 6098610527 Another big cull on unused variables and such 2010-10-29 21:55:29 +00:00
Sam Reed 961f512452 More deprecated method call removals and updates 2010-10-29 15:32:44 +00:00
Jack Phoenix 5e0330c6cc AbuseFilter: coding style tweaks, changed some while loops to foreach (as per http://www.mediawiki.org/wiki/Manual:Coding_conventions#Assignment_expressions) and added __METHOD__ to one DB query 2010-08-19 21:12:09 +00:00
Raimond Spekking de5b7258b9 Add accesskeys 's' for save actions 2010-03-13 17:35:12 +00:00
Siebrand Mazeland b274606879 Update code formatting, run stylize.php, whitespace updates 2010-02-13 14:10:36 +00:00
Jack Phoenix e2a16fe755 AbuseFilter: big commit - coding style & spacing cleanup; also marked SpecialPages' construct() and execute() functions as public and capitalized some SQL keywords 2009-10-07 13:57:06 +00:00
Andrew Garrett 13ab814753 AbuseFilter: Show permissions errors on new filter and importing a filter when the user does not have permission.
Resolves bug 20467
2009-09-18 10:05:20 +00:00