Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/60282


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, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/82/60282/1

diff --git a/CentralAuth.i18n.php b/CentralAuth.i18n.php
index 163275d..38e6f48 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',
diff --git a/specials/SpecialMultiLock.php b/specials/SpecialMultiLock.php
index bafd53b..9054c98 100644
--- a/specials/SpecialMultiLock.php
+++ b/specials/SpecialMultiLock.php
@@ -190,7 +190,8 @@
                                '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' => Xml::check( 
'bot' ) . $this->msg( 'centralauth-admin-multi-botcheck' )
                        ),
                        'centralauth-admin-status-submit'
                );
@@ -349,6 +350,13 @@
                        $setHidden = $this->mActionHide;
                }
 
+               if ( $this->getRequest()->getBool( 'bot', true ) ) {
+                       if ( in_array( 'bot', $this->getUser()->getRights() ) ) 
{
+                               $this->getUser()->mRights[] = 'bot';
+                               $toRemoveBotRight = true;
+                       }
+               }
+
                foreach ( $this->mGlobalUsers as $globalUser ) {
 
                        if ( !$globalUser instanceof CentralAuthUser ) {
@@ -370,6 +378,10 @@
                                $this->showSuccess( 
'centralauth-admin-setstatus-success', $globalUser->getName() );
                        }
                }
+
+               if ( $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: newchange
Gerrit-Change-Id: I225308fd939e1383c1e774ee806d159d7ca701cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>

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

Reply via email to