r36730 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36729‎ | r36730 | r36731 >
Date:12:52, 27 June 2008
Author:werdna
Status:old
Tags:
Comment:
Add shortcut "lock and hide" method for Special:CentralAuth
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuth.i18n.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/SpecialCentralAuth.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuth.php
@@ -192,6 +192,7 @@
193193 $wgLogActions['globalauth/unlock'] = 'centralauth-log-entry-unlock';
194194 $wgLogActions['globalauth/hide'] = 'centralauth-log-entry-hide';
195195 $wgLogActions['globalauth/unhide'] = 'centralauth-log-entry-unhide';
 196+$wgLogActions['globalauth/lockandhide'] = 'centralauth-log-entry-lockandhide';
196197
197198 $wgLogTypes[] = 'gblrights';
198199 $wgLogNames['gblrights'] = 'centralauth-rightslog-name';
Index: trunk/extensions/CentralAuth/SpecialCentralAuth.php
@@ -131,6 +131,20 @@
132132 $unhidden = true;
133133 $this->logAction( 'unhide', $this->mUserName, $wgRequest->getVal( 'reason' ) );
134134 }
 135+ } elseif ( $this->mMethod == 'lockandhide' ) {
 136+ $hStatus = $globalUser->adminHide();
 137+ if ( !$hStatus->isGood() ) {
 138+ $this->showStatusError( $status->getWikiText() );
 139+ }
 140+ $lStatus = $globalUser->adminLock();
 141+ if ( !$lStatus->isGood() ) {
 142+ $this->showStatusError( $status->getWikiText() );
 143+ } elseif ($hStatus->isGood()) {
 144+ global $wgLang;
 145+ $this->showSuccess( 'centralauth-admin-lockandhide-success', $this->mUserName );
 146+ $unhidden = true;
 147+ $this->logAction( 'lockandhide', $this->mUserName, $wgRequest->getVal( 'reason' ) );
 148+ }
135149 } else {
136150 $this->showError( 'centralauth-admin-bad-input' );
137151 }
@@ -151,6 +165,10 @@
152166 if( $globalUser->isHidden() && !$unhidden ) {
153167 $this->showActionForm( 'unhide' );
154168 }
 169+
 170+ if (!$globalUser->isHidden && !$globalUser->isLocked) {
 171+ $this->showActionForm( 'lockandhide' );
 172+ }
155173 }
156174 }
157175
Index: trunk/extensions/CentralAuth/CentralAuth.i18n.php
@@ -176,6 +176,12 @@
177177 'centralauth-admin-unhide-success' => 'Successfully unhid the global account for "<nowiki>$1</nowiki>"',
178178 'centralauth-admin-unhide-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
179179 'centralauth-admin-reason' => 'Reason:',
 180+ 'centralauth-admin-lockandhide-title' => 'Lock and Hide account',
 181+ 'centralauth-admin-lockandhide-description' => 'Locking and hiding this account will prevent it from logging in on any wiki, and hide it from the [[Special:GlobalUsers|list of global users]].',
 182+ 'centralauth-admin-lockandhide-button' => 'Lock and Hide this account',
 183+ 'centralauth-admin-lockandhide-success' => 'Successfully locked and hid the account',
 184+ 'centralauth-admin-lockandhide-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
 185+
180186
181187 // List of global users
182188 'globalusers' => 'Global user list',
@@ -223,6 +229,7 @@
224230 'centralauth-log-entry-unlock' => 'unlocked global account "<nowiki>$1</nowiki>"',
225231 'centralauth-log-entry-hide' => 'hid global account "<nowiki>$1</nowiki>"',
226232 'centralauth-log-entry-unhide' => 'unhid global account "<nowiki>$1</nowiki>"',
 233+ 'centralauth-log-entry-lockandhide' => 'locked and hid global account "<nowiki>$1</nowiki>"',
227234
228235 'centralauth-rightslog-name' => 'Global rights log',
229236 'centralauth-rightslog-entry-usergroups' => 'changed global group membership for $1 from $2 to $3',

Status & tagging log