jenkins-bot has submitted this change and it was merged.

Change subject: Allow MultiLock users to use a temporary bot right for 
RecentChange entries
......................................................................


Allow MultiLock users to use a temporary bot right for RecentChange entries

Bug: 47491
Change-Id: I225308fd939e1383c1e774ee806d159d7ca701cb
---
M CentralAuth.i18n.php
M specials/SpecialMultiLock.php
2 files changed, 19 insertions(+), 1 deletion(-)

Approvals:
  Hoo man: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CentralAuth.i18n.php b/CentralAuth.i18n.php
index 163275d..46e467a 100644
--- a/CentralAuth.i18n.php
+++ b/CentralAuth.i18n.php
@@ -230,6 +230,8 @@
        'centralauth-admin-action-hide-none'            => 'Unhide selected 
accounts',
        'centralauth-admin-action-hide-lists'           => 'Hide selected 
accounts from public lists',
        'centralauth-admin-action-hide-oversight'       => 'Completely hide 
selected accounts',
+       'centralauth-admin-multi-bot'                   => 'Recent changes',
+       'centralauth-admin-multi-botcheck'              => 'Mark entries on 
[[Special:RecentChanges]] as bot entries.',
 
        // Pretty timespan
        'centralauth-seconds-ago' => '$1 {{PLURAL:$1|second|seconds}} ago',
@@ -676,6 +678,8 @@
 {{Related|Centralauth-admin-action}}',
        'centralauth-admin-action-hide-oversight' => 'Radio button, suppress 
accounts.
 {{Related|Centralauth-admin-action}}',
+       'centralauth-admin-multi-bot' => 'Label shown next to the bot checkbox 
on Special:MultiLock',
+       'centralauth-admin-multi-botcheck' => 'Explanation of the bot checkbox 
on Special:MultiLock',
        'centralauth-seconds-ago' => '{{Related|Centralauth-ago}}',
        'centralauth-minutes-ago' => '{{Related|Centralauth-ago}}',
        'centralauth-hours-ago' => '{{Related|Centralauth-ago}}',
diff --git a/specials/SpecialMultiLock.php b/specials/SpecialMultiLock.php
index bafd53b..b516730 100644
--- a/specials/SpecialMultiLock.php
+++ b/specials/SpecialMultiLock.php
@@ -184,13 +184,15 @@
                        $this->msg( 'ipbreasonotherlist' 
)->inContentLanguage()->text()
                );
                $reasonField = Xml::input( 'wpReason', 45, false );
+               $botField = Xml::check( 'markasbot' ) . $this->msg( 
'centralauth-admin-multi-botcheck' );
 
                $form .= Xml::buildForm(
                        array(
                                'centralauth-admin-status-locked' => 
$radioLocked,
                                'centralauth-admin-status-hidden' => 
$radioHidden,
                                'centralauth-admin-reason' => $reasonList,
-                               'centralauth-admin-reason-other' => $reasonField
+                               'centralauth-admin-reason-other' => 
$reasonField,
+                               'centralauth-admin-multi-bot' => $botField
                        ),
                        'centralauth-admin-status-submit'
                );
@@ -349,6 +351,14 @@
                        $setHidden = $this->mActionHide;
                }
 
+               if ( $this->getRequest()->getCheck( 'markasbot' ) ) {
+                       if ( !$this->getUser()->isAllowed( 'bot' ) ) {
+                               $this->getUser()->mRights[] = 'bot';
+                               $toRemoveBotRight = true;
+                       }
+                       $this->getRequest()->setVal( 'bot', true );
+               }
+
                foreach ( $this->mGlobalUsers as $globalUser ) {
 
                        if ( !$globalUser instanceof CentralAuthUser ) {
@@ -370,6 +380,10 @@
                                $this->showSuccess( 
'centralauth-admin-setstatus-success', $globalUser->getName() );
                        }
                }
+
+               if ( isset( $toRemoveBotRight ) ) {
+                       unset( $this->getUser()->mRights[array_search( 'bot', 
$this->getUser()->mRights )] );
+               }
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/60282
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I225308fd939e1383c1e774ee806d159d7ca701cb
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to