2009-01-23 19:23:19 +00:00
|
|
|
<?php
|
2009-10-07 13:57:06 +00:00
|
|
|
if ( !defined( 'MEDIAWIKI' ) )
|
2009-01-23 19:23:19 +00:00
|
|
|
die();
|
|
|
|
|
|
|
|
class AbuseFilterViewTools extends AbuseFilterView {
|
2009-10-07 13:57:06 +00:00
|
|
|
function show() {
|
2011-11-16 05:34:24 +00:00
|
|
|
$out = $this->getOutput();
|
|
|
|
$user = $this->getUser();
|
2009-01-23 19:23:19 +00:00
|
|
|
|
|
|
|
// Header
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addWikiMsg( 'abusefilter-tools-text' );
|
2009-01-23 19:23:19 +00:00
|
|
|
|
|
|
|
// Expression evaluator
|
|
|
|
$eval = '';
|
2009-01-23 22:49:13 +00:00
|
|
|
$eval .= AbuseFilter::buildEditBox( '', 'wpTestExpr' );
|
2009-10-07 13:57:06 +00:00
|
|
|
|
2009-04-01 04:34:21 +00:00
|
|
|
// Only let users with permission actually test it
|
2011-11-16 05:34:24 +00:00
|
|
|
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
2009-10-07 13:57:06 +00:00
|
|
|
$eval .= Xml::tags( 'p', null,
|
|
|
|
Xml::element( 'input',
|
|
|
|
array(
|
|
|
|
'type' => 'button',
|
|
|
|
'id' => 'mw-abusefilter-submitexpr',
|
|
|
|
'value' => wfMsg( 'abusefilter-tools-submitexpr' ) )
|
|
|
|
)
|
2009-04-01 04:34:21 +00:00
|
|
|
);
|
|
|
|
$eval .= Xml::element( 'p', array( 'id' => 'mw-abusefilter-expr-result' ), ' ' );
|
|
|
|
}
|
2009-01-23 19:23:19 +00:00
|
|
|
$eval = Xml::fieldset( wfMsg( 'abusefilter-tools-expr' ), $eval );
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addHTML( $eval );
|
2009-01-23 19:23:19 +00:00
|
|
|
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addModules( 'ext.abuseFilter.tools' );
|
2009-01-23 19:23:19 +00:00
|
|
|
|
2011-11-16 05:34:24 +00:00
|
|
|
if ( $user->isAllowed( 'abusefilter-modify' ) ) {
|
2009-01-23 19:23:19 +00:00
|
|
|
// Hacky little box to re-enable autoconfirmed if it got disabled
|
|
|
|
$rac = '';
|
2009-10-07 13:57:06 +00:00
|
|
|
$rac .= Xml::inputLabel(
|
|
|
|
wfMsg( 'abusefilter-tools-reautoconfirm-user' ),
|
|
|
|
'wpReAutoconfirmUser',
|
2009-02-07 09:34:11 +00:00
|
|
|
'reautoconfirm-user',
|
2009-10-07 13:57:06 +00:00
|
|
|
45
|
|
|
|
);
|
2010-05-30 17:33:59 +00:00
|
|
|
$rac .= ' ';
|
2009-10-07 13:57:06 +00:00
|
|
|
$rac .= Xml::element(
|
|
|
|
'input',
|
|
|
|
array(
|
|
|
|
'type' => 'button',
|
|
|
|
'id' => 'mw-abusefilter-reautoconfirmsubmit',
|
|
|
|
'value' => wfMsg( 'abusefilter-tools-reautoconfirm-submit' )
|
|
|
|
)
|
2009-02-07 09:34:11 +00:00
|
|
|
);
|
2009-01-23 19:23:19 +00:00
|
|
|
$rac = Xml::fieldset( wfMsg( 'abusefilter-tools-reautoconfirm' ), $rac );
|
2011-11-16 05:34:24 +00:00
|
|
|
$out->addHTML( $rac );
|
2009-01-23 19:23:19 +00:00
|
|
|
}
|
|
|
|
}
|
2009-02-07 09:34:11 +00:00
|
|
|
}
|