mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 22:15:26 +00:00
020517dbe2
As described in the task, anyone can view the page but do nothing with it. It doesn't make sense, it should either work or be disabled. I chose the latter. Bug: T124096 Change-Id: I7271cd5a0d00d5fdba28ce3974c50ea5dfd0ad9b
56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?php
|
|
|
|
class AbuseFilterViewTools extends AbuseFilterView {
|
|
function show() {
|
|
$out = $this->getOutput();
|
|
$user = $this->getUser();
|
|
|
|
if ( !$user->isAllowed( 'abusefilter-modify' ) ) {
|
|
$out->addWikiMsg( 'abusefilter-mustbeeditor' );
|
|
return;
|
|
}
|
|
|
|
// Header
|
|
$out->addWikiMsg( 'abusefilter-tools-text' );
|
|
|
|
// Expression evaluator
|
|
$eval = '';
|
|
$eval .= AbuseFilter::buildEditBox( '', 'wpTestExpr' );
|
|
|
|
$eval .= Xml::tags( 'p', null,
|
|
Xml::element( 'input',
|
|
[
|
|
'type' => 'button',
|
|
'id' => 'mw-abusefilter-submitexpr',
|
|
'value' => $this->msg( 'abusefilter-tools-submitexpr' )->text() ]
|
|
)
|
|
);
|
|
$eval .= Xml::element( 'p', [ 'id' => 'mw-abusefilter-expr-result' ], ' ' );
|
|
|
|
$eval = Xml::fieldset( $this->msg( 'abusefilter-tools-expr' )->text(), $eval );
|
|
$out->addHTML( $eval );
|
|
|
|
$out->addModules( 'ext.abuseFilter.tools' );
|
|
|
|
// Hacky little box to re-enable autoconfirmed if it got disabled
|
|
$rac = '';
|
|
$rac .= Xml::inputLabel(
|
|
$this->msg( 'abusefilter-tools-reautoconfirm-user' )->text(),
|
|
'wpReAutoconfirmUser',
|
|
'reautoconfirm-user',
|
|
45
|
|
);
|
|
$rac .= ' ';
|
|
$rac .= Xml::element(
|
|
'input',
|
|
[
|
|
'type' => 'button',
|
|
'id' => 'mw-abusefilter-reautoconfirmsubmit',
|
|
'value' => $this->msg( 'abusefilter-tools-reautoconfirm-submit' )->text()
|
|
]
|
|
);
|
|
$rac = Xml::fieldset( $this->msg( 'abusefilter-tools-reautoconfirm' )->text(), $rac );
|
|
$out->addHTML( $rac );
|
|
}
|
|
}
|