Index: trunk/extensions/AbuseFilter/AbuseFilter.php |
— | — | @@ -69,4 +69,5 @@ |
70 | 70 | $wgAbuseFilterNativeExpressionEvaluator = "$dir/parser_native/af_expr"; |
71 | 71 | |
72 | 72 | $wgAjaxExportList[] = 'AbuseFilter::ajaxCheckSyntax'; |
73 | | -$wgAjaxExportList[] = 'AbuseFilter::ajaxEvaluateExpression'; |
\ No newline at end of file |
| 73 | +$wgAjaxExportList[] = 'AbuseFilter::ajaxEvaluateExpression'; |
| 74 | +$wgAjaxExportList[] = 'AbuseFilter::ajaxReAutoconfirm'; |
\ No newline at end of file |
Index: trunk/extensions/AbuseFilter/SpecialAbuseFilter.php |
— | — | @@ -152,9 +152,28 @@ |
153 | 153 | |
154 | 154 | var el = document.getElementById( 'mw-abusefilter-expr-result' ); |
155 | 155 | changeText( el, response ); |
156 | | - }"; |
| 156 | + } |
| 157 | + function doReautoSubmit() |
| 158 | + { |
| 159 | + var name = document.getElementById('reautoconfirm-user').value; |
| 160 | + injectSpinner( document.getElementById( 'mw-abusefilter-reautoconfirmsubmit' ), 'abusefilter-reautoconfirm' ); |
| 161 | + sajax_do_call( 'AbuseFilter::ajaxReAutoconfirm', [name], processReautoconfirm ); |
| 162 | + } |
| 163 | + function processReautoconfirm( request ) { |
| 164 | + var response = request.responseText; |
| 165 | + |
| 166 | + removeSpinner( 'abusefilter-reautoconfirm' ); |
| 167 | + } |
| 168 | + "; |
157 | 169 | |
158 | 170 | $wgOut->addInlineScript( $exprScript ); |
| 171 | + |
| 172 | + // Hacky little box to re-enable autoconfirmed if it got disabled |
| 173 | + $rac = ''; |
| 174 | + $rac .= Xml::inputLabel( wfMsg( 'abusefilter-tools-reautoconfirm-user' ), 'wpReAutoconfirmUser', 'reautoconfirm-user', 45 ); |
| 175 | + $rac .= Xml::element( 'input', array( 'type' => 'button', 'id' => 'mw-abusefilter-reautoconfirmsubmit', 'onclick' => 'doReautoSubmit();', 'value' => wfMsg( 'abusefilter-tools-reautoconfirm-submit' ) ) ); |
| 176 | + $rac = Xml::fieldset( wfMsg( 'abusefilter-tools-reautoconfirm' ), $rac ); |
| 177 | + $wgOut->addHtml( $rac ); |
159 | 178 | } |
160 | 179 | |
161 | 180 | function showStatus() { |
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php |
— | — | @@ -91,6 +91,14 @@ |
92 | 92 | return $parser->evaluateExpression( $expr ); |
93 | 93 | } |
94 | 94 | |
| 95 | + public static function ajaxReAutoconfirm( $username ) { |
| 96 | + $u = User::newFromName( $username ); |
| 97 | + |
| 98 | + global $wgMemc; |
| 99 | + $k = AbuseFilter::autoPromoteBlockKey($u); |
| 100 | + $wgMemc->delete( $k ); |
| 101 | + } |
| 102 | + |
95 | 103 | public static function ajaxEvaluateExpression( $expr ) { |
96 | 104 | return self::evaluateExpression( $expr ); |
97 | 105 | } |
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php |
— | — | @@ -103,6 +103,9 @@ |
104 | 104 | 'abusefilter-tools-text' => 'Here are some tools which may be useful in formulating and debugging abuse filters. [[Special:AbuseFilter|Return to main menu]]', |
105 | 105 | 'abusefilter-tools-expr' => 'Expression tester', |
106 | 106 | 'abusefilter-tools-submitexpr' => 'Evaluate', |
| 107 | + 'abusefilter-tools-reautoconfirm' => 'Restore autoconfirmed status', |
| 108 | + 'abusefilter-tools-reautoconfirm-user' => 'User', |
| 109 | + 'abusefilter-tools-reautoconfirm-submit' => 'Re-autoconfirm', |
107 | 110 | |
108 | 111 | // Abuse filter status |
109 | 112 | 'abusefilter-status' => "Of the last $1 {{PLURAL:$1|action|actions}}, $2 ($3%) {{PLURAL:$2|has|have}} reached the condition limit of $4. $5 ($6%) {{PLURAL:$5|has|have}} matched one of the filters currently enabled.", |
Index: trunk/extensions/AbuseFilter/abusefilter.tables.sql |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | afh_flags TINYBLOB NOT NULL, |
61 | 61 | afh_public_comments TINYBLOB, |
62 | 62 | afh_actions BLOB, |
| 63 | + afh_deleted tinyint(1) NOT NULL DEFAULT 0, |
63 | 64 | |
64 | 65 | PRIMARY KEY (afh_id), |
65 | 66 | KEY (afh_filter), |