mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 13:46:48 +00:00
Don't show the form for restoring autopromotion to unprivileged users
Bug: T232881 Change-Id: I80c34c823f505c81e20f83ccf5c5a99e8e69b626
This commit is contained in:
parent
f4b555f113
commit
ed2bc7badf
|
@ -40,22 +40,24 @@ class AbuseFilterViewTools extends AbuseFilterView {
|
|||
|
||||
$out->addModules( 'ext.abuseFilter.tools' );
|
||||
|
||||
// Hacky little box to re-enable autoconfirmed if it got disabled
|
||||
$formDescriptor = [
|
||||
'RestoreAutoconfirmed' => [
|
||||
'label-message' => 'abusefilter-tools-reautoconfirm-user',
|
||||
'type' => 'user',
|
||||
'name' => 'wpReAutoconfirmUser',
|
||||
'id' => 'reautoconfirm-user',
|
||||
'infusable' => true
|
||||
],
|
||||
];
|
||||
$htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
|
||||
$htmlForm->setWrapperLegendMsg( 'abusefilter-tools-reautoconfirm' )
|
||||
->setSubmitTextMsg( 'abusefilter-tools-reautoconfirm-submit' )
|
||||
->setSubmitName( 'wpReautoconfirmSubmit' )
|
||||
->setSubmitId( 'mw-abusefilter-reautoconfirmsubmit' )
|
||||
->prepareForm()
|
||||
->displayForm( false );
|
||||
if ( AbuseFilter::canEdit( $this->getUser() ) ) {
|
||||
// Hacky little box to re-enable autoconfirmed if it got disabled
|
||||
$formDescriptor = [
|
||||
'RestoreAutoconfirmed' => [
|
||||
'label-message' => 'abusefilter-tools-reautoconfirm-user',
|
||||
'type' => 'user',
|
||||
'name' => 'wpReAutoconfirmUser',
|
||||
'id' => 'reautoconfirm-user',
|
||||
'infusable' => true
|
||||
],
|
||||
];
|
||||
$htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
|
||||
$htmlForm->setWrapperLegendMsg( 'abusefilter-tools-reautoconfirm' )
|
||||
->setSubmitTextMsg( 'abusefilter-tools-reautoconfirm-submit' )
|
||||
->setSubmitName( 'wpReautoconfirmSubmit' )
|
||||
->setSubmitId( 'mw-abusefilter-reautoconfirmsubmit' )
|
||||
->prepareForm()
|
||||
->displayForm( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,6 +110,8 @@
|
|||
|
||||
$( function initialize() {
|
||||
$( '#mw-abusefilter-submitexpr' ).on( 'click', doExprSubmit );
|
||||
$( '#mw-abusefilter-reautoconfirmsubmit' ).on( 'click', doReautoSubmit );
|
||||
if ( $( '#mw-abusefilter-reautoconfirmsubmit' ).length ) {
|
||||
$( '#mw-abusefilter-reautoconfirmsubmit' ).on( 'click', doReautoSubmit );
|
||||
}
|
||||
} );
|
||||
}() );
|
||||
|
|
Loading…
Reference in a new issue