mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-14 09:44:44 +00:00
274dcd06a2
The main AbuseFilter class still needs to be fixed up, but that's a bigger job and I'm out of time
57 lines
1.5 KiB
PHP
57 lines
1.5 KiB
PHP
<?php
|
|
if ( !defined( 'MEDIAWIKI' ) )
|
|
die();
|
|
|
|
class AbuseFilterViewTools extends AbuseFilterView {
|
|
function show() {
|
|
$out = $this->getOutput();
|
|
$user = $this->getUser();
|
|
|
|
// Header
|
|
$out->addWikiMsg( 'abusefilter-tools-text' );
|
|
|
|
// Expression evaluator
|
|
$eval = '';
|
|
$eval .= AbuseFilter::buildEditBox( '', 'wpTestExpr' );
|
|
|
|
// Only let users with permission actually test it
|
|
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
|
$eval .= Xml::tags( 'p', null,
|
|
Xml::element( 'input',
|
|
array(
|
|
'type' => 'button',
|
|
'id' => 'mw-abusefilter-submitexpr',
|
|
'value' => wfMsg( 'abusefilter-tools-submitexpr' ) )
|
|
)
|
|
);
|
|
$eval .= Xml::element( 'p', array( 'id' => 'mw-abusefilter-expr-result' ), ' ' );
|
|
}
|
|
$eval = Xml::fieldset( wfMsg( 'abusefilter-tools-expr' ), $eval );
|
|
$out->addHTML( $eval );
|
|
|
|
$out->addModules( 'ext.abuseFilter.tools' );
|
|
|
|
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
|
// Hacky little box to re-enable autoconfirmed if it got disabled
|
|
$rac = '';
|
|
$rac .= Xml::inputLabel(
|
|
wfMsg( 'abusefilter-tools-reautoconfirm-user' ),
|
|
'wpReAutoconfirmUser',
|
|
'reautoconfirm-user',
|
|
45
|
|
);
|
|
$rac .= ' ';
|
|
$rac .= Xml::element(
|
|
'input',
|
|
array(
|
|
'type' => 'button',
|
|
'id' => 'mw-abusefilter-reautoconfirmsubmit',
|
|
'value' => wfMsg( 'abusefilter-tools-reautoconfirm-submit' )
|
|
)
|
|
);
|
|
$rac = Xml::fieldset( wfMsg( 'abusefilter-tools-reautoconfirm' ), $rac );
|
|
$out->addHTML( $rac );
|
|
}
|
|
}
|
|
}
|