r35928 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35927‎ | r35928 | r35929 >
Date:13:36, 5 June 2008
Author:vasilievvv
Status:old
Tags:
Comment:
* Introduce blocking of SUL accounts
* Prettify Special:CentralAuth a bit
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuth.i18n.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuthBlock.php (added) (history)
  • /trunk/extensions/CentralAuth/CentralAuthHooks.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuthUser.php (modified) (history)
  • /trunk/extensions/CentralAuth/SpecialCentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/central-auth.sql (modified) (history)
  • /trunk/extensions/CentralAuth/db_patches/patch-globalblocks.sql (added) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/central-auth.sql
@@ -134,3 +134,24 @@
135135 KEY (ggp_group),
136136 KEY (ggp_permission)
137137 ) /*$wgDBTableOptions*/;
 138+
 139+-- Blocks of global users
 140+CREATE TABLE /*$wgDBprefix*/globalblock (
 141+ gb_id int NOT NULL auto_increment,
 142+ gb_user int unsigned NOT NULL default '0',
 143+ gb_user_text tinyblob NOT NULL,
 144+ gb_by_text varchar(255) binary NOT NULL default '',
 145+ gb_reason tinyblob NOT NULL,
 146+ gb_timestamp binary(14) NOT NULL default '',
 147+ -- May be "infinity"
 148+ gb_expiry varbinary(14) NOT NULL default '',
 149+ gb_block_email bool NOT NULL default 0,
 150+
 151+ PRIMARY KEY gb_id (gb_id),
 152+ UNIQUE INDEX gb_user_text (gb_user_text(255), gb_user),
 153+
 154+ INDEX gb_user (gb_user),
 155+ INDEX gb_timestamp (gb_timestamp),
 156+ INDEX gb_expiry (gb_expiry)
 157+
 158+) /*$wgDBTableOptions*/;
Index: trunk/extensions/CentralAuth/db_patches/patch-globalblocks.sql
@@ -0,0 +1,19 @@
 2+CREATE TABLE /*$wgDBprefix*/globalblock (
 3+ gb_id int NOT NULL auto_increment,
 4+ gb_user int unsigned NOT NULL default '0',
 5+ gb_user_text tinyblob NOT NULL,
 6+ gb_by_text varchar(255) binary NOT NULL default '',
 7+ gb_reason tinyblob NOT NULL,
 8+ gb_timestamp binary(14) NOT NULL default '',
 9+ -- May be "infinity"
 10+ gb_expiry varbinary(14) NOT NULL default '',
 11+ gb_block_email bool NOT NULL default 0,
 12+
 13+ PRIMARY KEY gb_id (gb_id),
 14+ UNIQUE INDEX gb_user_text (gb_user_text(255), gb_user),
 15+
 16+ INDEX gb_user (gb_user),
 17+ INDEX gb_timestamp (gb_timestamp),
 18+ INDEX gb_expiry (gb_expiry)
 19+
 20+) /*$wgDBTableOptions*/;
\ No newline at end of file
Property changes on: trunk/extensions/CentralAuth/db_patches/patch-globalblocks.sql
___________________________________________________________________
Name: svn:eol-style
121 + native
Index: trunk/extensions/CentralAuth/CentralAuthUser.php
@@ -20,6 +20,7 @@
2121 /*private*/ var $mStateDirty = false;
2222 /*private*/ var $mVersion = 1;
2323 /*private*/ var $mDelayInvalidation = 0;
 24+ /*private*/ var $mBlock = false;
2425
2526 static $mCacheVars = array(
2627 'mGlobalId',
@@ -33,6 +34,7 @@
3435 'mAuthenticationTimestamp',
3536 'mGroups',
3637 'mRights',
 38+ 'mBlock',
3739
3840 # Store the string list instead of the array, to save memory, and
3941 # avoid unserialize() overhead
@@ -140,6 +142,7 @@
141143 $dbr->freeResult( $result );
142144
143145 $this->loadFromRow( $row, true );
 146+ $this->mBlock = CentralAuthBlock::newFromUser( $this );
144147 $this->saveToCache();
145148 wfProfileOut( __METHOD__ );
146149 }
@@ -1829,4 +1832,14 @@
18301833 public function attachedOn( $wiki ) {
18311834 return $this->exists() && in_array( $wiki, $this->mAttachedArray );
18321835 }
 1836+
 1837+ public function isBlocked() {
 1838+ $this->loadState();
 1839+ return (bool)$this->mBlock;
 1840+ }
 1841+
 1842+ public function getBlock() {
 1843+ $this->loadState();
 1844+ return $this->mBlock;
 1845+ }
18331846 }
Index: trunk/extensions/CentralAuth/CentralAuth.php
@@ -121,6 +121,7 @@
122122 $wgAutoloadClasses['CentralAuthUser'] = "$caBase/CentralAuthUser.php";
123123 $wgAutoloadClasses['CentralAuthPlugin'] = "$caBase/CentralAuthPlugin.php";
124124 $wgAutoloadClasses['CentralAuthHooks'] = "$caBase/CentralAuthHooks.php";
 125+$wgAutoloadClasses['CentralAuthBlock'] = "$caBase/CentralAuthBlock.php";
125126 $wgAutoloadClasses['WikiMap'] = "$caBase/WikiMap.php";
126127 $wgAutoloadClasses['WikiReference'] = "$caBase/WikiMap.php";
127128 $wgAutoloadClasses['SpecialAutoLogin'] = "$caBase/SpecialAutoLogin.php";
@@ -171,17 +172,31 @@
172173 $wgSpecialPages['GlobalUsers'] = 'SpecialGlobalUsers';
173174 $wgSpecialPageGroups['GlobalUsers'] = 'users';
174175
175 -$wgLogTypes[] = 'globalauth';
176 -$wgLogNames['globalauth'] = 'centralauth-log-name';
177 -$wgLogHeaders['globalauth'] = 'centralauth-log-header';
178 -$wgLogActions['globalauth/delete'] = 'centralauth-log-entry-delete';
179 -$wgLogActions['globalauth/lock'] = 'centralauth-log-entry-lock';
180 -$wgLogActions['globalauth/unlock'] = 'centralauth-log-entry-unlock';
181 -$wgLogActions['globalauth/hide'] = 'centralauth-log-entry-hide';
182 -$wgLogActions['globalauth/unhide'] = 'centralauth-log-entry-unhide';
 176+$wgLogTypes[] = 'globalauth';
 177+$wgLogNames['globalauth'] = 'centralauth-log-name';
 178+$wgLogHeaders['globalauth'] = 'centralauth-log-header';
 179+$wgLogActions['globalauth/delete'] = 'centralauth-log-entry-delete';
 180+$wgLogActions['globalauth/lock'] = 'centralauth-log-entry-lock';
 181+$wgLogActions['globalauth/unlock'] = 'centralauth-log-entry-unlock';
 182+$wgLogActions['globalauth/hide'] = 'centralauth-log-entry-hide';
 183+$wgLogActions['globalauth/unhide'] = 'centralauth-log-entry-unhide';
 184+$wgLogActions['globalauth/unblock'] = 'centralauth-log-entry-unblock';
 185+$wgLogActionsHandlers['globalauth/block'] = 'efCentralAuthBlockLogHandler';
183186
184187 $wgLogTypes[] = 'gblrights';
185188 $wgLogNames['gblrights'] = 'centralauth-rightslog-name';
186189 $wgLogHeaders['gblrights'] = 'centralauth-rightslog-header';
187190 $wgLogActions['gblrights/usergroups'] = 'centralauth-rightslog-entry-usergroups';
188191 $wgLogActions['gblrights/groupperms'] = 'centralauth-rightslog-entry-groupperms';
 192+
 193+function efCentralAuthBlockLogHandler( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false ) {
 194+ global $wgLang, $wgContLang;
 195+ $expiry = @$params[0]; //Giving some weird notices while $params[0] is set
 196+ $msgParams = array( $title, '' );
 197+ if ( $skin ) {
 198+ $msgParams[1] = '<span title="' . htmlspecialchars( $expiry ). '">' . $wgLang->translateBlockExpiry( $expiry ) . '</span>';
 199+ } else {
 200+ $msgParams[1] = $wgContLang->translateBlockExpiry( $expiry );
 201+ }
 202+ return wfMsgReal( 'centralauth-log-entry-block', $msgParams, true, !$skin );
 203+}
Index: trunk/extensions/CentralAuth/SpecialCentralAuth.php
@@ -66,7 +66,8 @@
6767 return;
6868 }
6969
70 - $deleted = $locked = $unlocked = $hidden = $unhidden = false;
 70+ $deleted = $locked = $unlocked = $hidden =
 71+ $unhidden = $blocked = $unblocked = false;
7172
7273 if( $this->mPosted ) {
7374 if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
@@ -86,7 +87,6 @@
8788 if ( !$status->isGood() ) {
8889 $this->showStatusError( $status->getWikiText() );
8990 } else {
90 - global $wgLang;
9191 $this->showSuccess( 'centralauth-admin-delete-success', $this->mUserName );
9292 $deleted = true;
9393 $this->logAction( 'delete', $this->mUserName, $wgRequest->getVal( 'reason' ) );
@@ -96,7 +96,6 @@
9797 if ( !$status->isGood() ) {
9898 $this->showStatusError( $status->getWikiText() );
9999 } else {
100 - global $wgLang;
101100 $this->showSuccess( 'centralauth-admin-lock-success', $this->mUserName );
102101 $locked = true;
103102 $this->logAction( 'lock', $this->mUserName, $wgRequest->getVal( 'reason' ) );
@@ -106,7 +105,6 @@
107106 if ( !$status->isGood() ) {
108107 $this->showStatusError( $status->getWikiText() );
109108 } else {
110 - global $wgLang;
111109 $this->showSuccess( 'centralauth-admin-unlock-success', $this->mUserName );
112110 $unlocked = true;
113111 $this->logAction( 'unlock', $this->mUserName, $wgRequest->getVal( 'reason' ) );
@@ -116,7 +114,6 @@
117115 if ( !$status->isGood() ) {
118116 $this->showStatusError( $status->getWikiText() );
119117 } else {
120 - global $wgLang;
121118 $this->showSuccess( 'centralauth-admin-hide-success', $this->mUserName );
122119 $hidden = true;
123120 $this->logAction( 'hide', $this->mUserName, $wgRequest->getVal( 'reason' ) );
@@ -126,11 +123,43 @@
127124 if ( !$status->isGood() ) {
128125 $this->showStatusError( $status->getWikiText() );
129126 } else {
130 - global $wgLang;
131127 $this->showSuccess( 'centralauth-admin-unhide-success', $this->mUserName );
132128 $unhidden = true;
133129 $this->logAction( 'unhide', $this->mUserName, $wgRequest->getVal( 'reason' ) );
134130 }
 131+ } elseif( $this->mMethod == 'block' ) {
 132+ $block = new CentralAuthBlock();
 133+ $block->setUser( $globalUser );
 134+ $block->setBy( $wgUser->getName() . '@' . wfWikiID() );
 135+ $block->setReason( $wgRequest->getVal( 'reason' ) );
 136+ $expiry = Block::parseExpiryInput( $wgRequest->getVal( 'expiry' ) );
 137+ if( $expiry === false ) {
 138+ $this->showError( 'centralauth-admin-block-badexpiry' );
 139+ } else {
 140+ $block->setExpiry( $expiry );
 141+ $result = $block->insert();
 142+ if( $result ) {
 143+ $this->showSuccess( 'centralauth-admin-block-success', $this->mUserName );
 144+ $blocked = true;
 145+ $globalUser->invalidateCache();
 146+ $globalUser->mBlock = $block;
 147+ $this->logAction( 'block', $this->mUserName, $wgRequest->getVal( 'reason' ),
 148+ array( $wgRequest->getVal( 'expiry' ) ) );
 149+ } else {
 150+ $this->showError( 'centralauth-admin-block-already', $this->mUserName );
 151+ }
 152+ }
 153+ } elseif( $this->mMethod == 'unblock' ) {
 154+ $block = $globalUser->getBlock();
 155+ if( !$block || $block->deleteIfExpired() ) {
 156+ $this->showError( 'centralauth-admin-unblock-notblocked', $this->mUserName );
 157+ }
 158+ $block->delete();
 159+ $unblocked = true;
 160+ $globalUser->invalidateCache();
 161+ $globalUser->mBlock = null;
 162+ $this->showSuccess( 'centralauth-admin-unblock-success', $this->mUserName );
 163+ $this->logAction( 'unblock', $this->mUserName, $wgRequest->getVal( 'reason' ) );
135164 } else {
136165 $this->showError( 'centralauth-admin-bad-input' );
137166 }
@@ -141,6 +170,10 @@
142171 if ( !$deleted ) {
143172 $this->showInfo();
144173 $this->showActionForm( 'delete' );
 174+ if( !$globalUser->isBlocked() && !$blocked )
 175+ $this->showBlockForm();
 176+ if( $globalUser->isBlocked() && !$unblocked )
 177+ $this->showActionForm( 'unblock' );
145178 if( !$globalUser->isLocked() && !$locked )
146179 $this->showActionForm( 'lock' );
147180 if( $globalUser->isLocked() && !$unlocked )
@@ -336,27 +369,57 @@
337370 }
338371
339372 function showActionForm( $action ) {
340 - global $wgOut, $wgUser;
 373+ global $wgOut, $wgUser, $wgContLang;
 374+ $td1 = "<td align=\"" . ( $wgContLang->isRTL() ? 'left' : 'right' ) . "\">";
 375+ $td2 = "<td align=\"" . ( $wgContLang->isRTL() ? 'right' : 'left' ) . "\">";
341376 $wgOut->addHtml(
342377 Xml::element( 'h2', array(), wfMsg( "centralauth-admin-{$action}-title" ) ) .
343378 Xml::openElement( 'form', array(
344379 'method' => 'POST',
345380 'action' => $this->getTitle()->getFullUrl( 'target=' . urlencode( $this->mUserName ) ) ) ) .
346381 Xml::hidden( 'wpMethod', $action ) .
 382+ wfMsgExt( "centralauth-admin-{$action}-description", 'parse' ) .
 383+ '<table>' .
 384+ '<tr>' .
 385+ $td1 . Xml::label( wfMsgHtml( 'centralauth-admin-reason' ), "{$action}-reason" ) . '</td>' .
 386+ $td2 . Xml::input( 'reason', false, false, array( 'id' => "{$action}-reason" ) ) . '</td>' .
 387+ '</tr>' .
 388+ '<tr>' . $td1 . '</td>' .
 389+ $td2 . Xml::submitButton( wfMsg( "centralauth-admin-{$action}-button" ) ) . '</td>' .
347390 Xml::hidden( 'wpEditToken', $wgUser->editToken() ) .
348 - wfMsgExt( "centralauth-admin-{$action}-description", 'parse' ) .
349 - '<p>' .
350 - Xml::label( wfMsgHtml( 'centralauth-admin-reason' ), "{$action}-reason" ) . ' ' .
351 - Xml::input( 'reason', false, false, array( 'id' => "{$action}-reason" ) ) .
352 - '</p>' .
353 - '<p>' .
354 - Xml::submitButton( wfMsg( "centralauth-admin-{$action}-button" ) ) .
355 - '</p>' .
356 - '</form>' );
 391+ '</tr>' .
 392+ '</table></form>' );
357393 }
358394
359 - function logAction( $action, $target, $reason = '' ) {
 395+ function showBlockForm() {
 396+ global $wgOut, $wgUser, $wgContLang;
 397+ $td1 = "<td align=\"" . ( $wgContLang->isRTL() ? 'left' : 'right' ) . "\">";
 398+ $td2 = "<td align=\"" . ( $wgContLang->isRTL() ? 'right' : 'left' ) . "\">";
 399+ $wgOut->addHtml(
 400+ Xml::element( 'h2', array(), wfMsg( "centralauth-admin-block-title" ) ) .
 401+ Xml::openElement( 'form', array(
 402+ 'method' => 'POST',
 403+ 'action' => $this->getTitle()->getFullUrl( 'target=' . urlencode( $this->mUserName ) ) ) ) .
 404+ Xml::hidden( 'wpMethod', 'block' ) .
 405+ wfMsgExt( "centralauth-admin-block-description", 'parse' ) .
 406+ '<table>' .
 407+ '<tr>' .
 408+ $td1 . Xml::label( wfMsgHtml( 'centralauth-admin-reason' ), "block-reason" ) . '</td>' .
 409+ $td2 . Xml::input( 'reason', false, false, array( 'id' => "block-reason" ) ) . '</td>' .
 410+ '</tr>' .
 411+ '<tr>' .
 412+ $td1 . Xml::label( wfMsgHtml( 'centralauth-admin-expiry' ), "block-expiry" ) . '</td>' .
 413+ $td2 . Xml::input( 'expiry', false, false, array( 'id' => "block-expiry" ) ) . '</td>' .
 414+ '</tr>' .
 415+ '<tr>' . $td1 . '</td>' .
 416+ $td2 . Xml::submitButton( wfMsg( "centralauth-admin-block-button" ) ) . '</td>' .
 417+ Xml::hidden( 'wpEditToken', $wgUser->editToken() ) .
 418+ '</tr>' .
 419+ '</table></form>' );
 420+ }
 421+
 422+ function logAction( $action, $target, $reason = '', $params = array() ) {
360423 $log = new LogPage( 'globalauth' ); //Not centralauth because of some weird length limitiations
361 - $log->addEntry( $action, Title::newFromText( "User:{$target}@global" ), $reason );
 424+ $log->addEntry( $action, Title::newFromText( "User:{$target}@global" ), $reason, $params );
362425 }
363426 }
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php
@@ -473,6 +473,7 @@
474474 }
475475
476476 static function onGetUserPermissionsErrorsExpensive( $title, $user, $action, &$result ) {
 477+ global $wgLang;
477478 if( $action == 'read' || $user->isAnon() ) {
478479 return true;
479480 }
@@ -484,6 +485,24 @@
485486 $result = 'centralauth-error-locked';
486487 return false;
487488 }
 489+ if( $centralUser->isBlocked() ) {
 490+ $block = $centralUser->getBlock();
 491+ if( $block->deleteIfExpired() ) {
 492+ return true;
 493+ }
 494+ wfLoadExtensionMessages( 'SpecialCentralAuth' );
 495+ $result = array(
 496+ 'centralauth-blocked',
 497+ $block->getBy(),
 498+ $block->getReason(),
 499+ $block->getUser()->getName(),
 500+ $block->getId(),
 501+ $wgLang->timeanddate( wfTimestamp( TS_MW, $block->getExpiry() ), true ),
 502+ $wgLang->timeanddate( wfTimestamp( TS_MW, $block->getTimestamp() ), true ),
 503+ $block->getByStripped(),
 504+ );
 505+ return false;
 506+ }
488507 return true;
489508 }
490509 }
Index: trunk/extensions/CentralAuth/CentralAuthBlock.php
@@ -0,0 +1,145 @@
 2+<?php
 3+
 4+class CentralAuthBlock {
 5+ private $mId, $mUser, $mUserText, $mUserObj,
 6+ $mByText, $mReason, $mTimestamp,
 7+ $mExpiry, $mBlockEmail; // @fixme we need to implement email blocks
 8+
 9+ public function __construct() {
 10+ $this->mId =
 11+ $this->mUser =
 12+ $this->mBlockEmail =
 13+ 0;
 14+ $this->mUserText =
 15+ $this->mByText =
 16+ $this->mReason =
 17+ $this->mExpire =
 18+ '';
 19+ $this->mUserObj =
 20+ null;
 21+ }
 22+
 23+ /** Constructors */
 24+ public static function newFromRow( $row ) {
 25+ if( !$row )
 26+ return null;
 27+
 28+ $block = new CentralAuthBlock();
 29+ $block->mId = $row->gb_id;
 30+ $block->mUser = $row->gb_user;
 31+ $block->mUserText = $row->gb_user_text;
 32+ $block->mByText = $row->gb_by_text;
 33+ $block->mReason = $row->gb_reason;
 34+ $block->mTimestamp = $row->gb_timestamp;
 35+ $block->mExpiry = Block::decodeExpiry( $row->gb_expiry );
 36+ $block->mBlockEmail = (bool)$row->gb_block_email;
 37+ return $block;
 38+ }
 39+
 40+ public static function newFromUser( CentralAuthUser $u ) {
 41+ $dbr = CentralAuthUser::getCentralSlaveDB();
 42+ $r = $dbr->select( 'globalblock', '*', array( 'gb_user' => $u->getId() ), __METHOD__ );
 43+ $row = $dbr->fetchObject( $r );
 44+ $dbr->freeResult( $r );
 45+ return self::newFromRow( $row );
 46+ }
 47+
 48+ /** Getters/setters block */
 49+ public function getId() { return $this->mId; }
 50+ public function getUserText() { return $this->mUserText; }
 51+ public function getUserId() { return $this->mUser; }
 52+ public function getBy() { return $this->mByText; }
 53+ public function setBy($s) { $this->mByText = $s; }
 54+ public function getReason() { return $this->mReason; }
 55+ public function setReason($r) { $this->mReason = $r; }
 56+ public function getTimestamp() { return $this->mTimestamp; }
 57+ public function getExpiry() { return $this->mExpiry; }
 58+ public function getBlockEmail() { return $this->mBlockEmail; }
 59+ public function setBlockEmail($b) { $this->mBlockEmail = $b; }
 60+ public function setUser( CentralAuthUser $u ) {
 61+ $this->mUserObj = $u;
 62+ $this->mUser = $u->getId();
 63+ $this->mUserText = $u->getName();
 64+ }
 65+ public function setExpiry( $expiry ) {
 66+ $this->mExpiry = $expiry;
 67+ }
 68+ public function getUser() {
 69+ return $this->mUserObj ? $this->mUserObj : new CentralAuthUser( $this->mUserText );
 70+ }
 71+ public function getByStripped() {
 72+ $bits = explode( '@', $this->mByText, 2 );
 73+ return $bits[0];
 74+ }
 75+
 76+ /**
 77+ * Deletes block if it exists
 78+ * @return false on failure, true on success
 79+ */
 80+ public function delete() {
 81+ if( wfReadOnly() )
 82+ return false;
 83+
 84+ $dbw = CentralAuthUser::getCentralDB();
 85+ $dbw->delete( 'globalblock', array( 'gb_id' => $this->mId ), __METHOD__ );
 86+ $dbw->commit();
 87+ return $dbw->affectedRows() > 0;
 88+ }
 89+
 90+ /**
 91+ * Inserts a new block into the globalblock table.
 92+ * @return false on failure, true on success
 93+ */
 94+ public function insert() {
 95+ if( wfReadOnly() )
 96+ return false;
 97+
 98+ self::purgeExpired();
 99+ $dbw = CentralAuthUser::getCentralDB();
 100+ $dbw->insert( 'globalblock',
 101+ array(
 102+ 'gb_id' => 0,
 103+ 'gb_user' => $this->mUser,
 104+ 'gb_user_text' => $this->mUserText,
 105+ 'gb_by_text' => $this->mByText,
 106+ 'gb_reason' => $this->mReason,
 107+ 'gb_timestamp' => $dbw->timestamp(),
 108+ 'gb_expiry' => Block::encodeExpiry( $this->mExpiry, $dbw ),
 109+ 'gb_block_email' => 0, //is not implemented yet
 110+ ), __METHOD__, array( 'IGNORE' )
 111+ );
 112+ return $dbw->affectedRows() > 0;
 113+ }
 114+
 115+ /**
 116+ * Checks if block is expired.
 117+ * @return boolean
 118+ */
 119+ public function isExpired() {
 120+ if( !$this->mExpiry ) {
 121+ return false;
 122+ }
 123+ return wfTimestampNow() > $this->mExpiry;
 124+ }
 125+
 126+ /**
 127+ * Deletes block if it's expired
 128+ * @return boolean
 129+ */
 130+ public function deleteIfExpired() {
 131+ if( $this->isExpired() ) {
 132+ $this->delete();
 133+ return true;
 134+ } else {
 135+ return false;
 136+ }
 137+ }
 138+
 139+ /**
 140+ * Deletes all expired blocks.
 141+ */
 142+ public static function purgeExpired() {
 143+ $dbw = CentralAuthUser::getCentralDB();
 144+ $dbw->delete( 'globalblock', array( 'gb_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), __METHOD__ );
 145+ }
 146+}
\ No newline at end of file
Property changes on: trunk/extensions/CentralAuth/CentralAuthBlock.php
___________________________________________________________________
Name: svn:eol-style
1147 + native
Index: trunk/extensions/CentralAuth/CentralAuth.i18n.php
@@ -70,7 +70,17 @@
7171
7272 'centralauth-disabled-dryrun' => "Account unification is currently in a demo / debugging mode, so actual merging operations are disabled. Sorry!",
7373 'centralauth-error-locked' => 'You cannot edit because your account is locked.',
 74+ 'centralauth-blocked' => "<big>'''Your account has been blocked globally.'''</big>
7475
 76+The block was made by $1. The reason given is ''$2''.
 77+
 78+* Start of block: $6
 79+* Expiry of block: $5
 80+* Intended blockee: $3
 81+
 82+You can contact $7 or another steward to discuss the block.
 83+You cannot use the 'e-mail this user' feature unless a valid e-mail address is specified in your [[Special:Preferences|account preferences]] and you have not been blocked from using it.",
 84+
7585 // Appended to various messages above
7686 'centralauth-readmore-text' => ":''[[meta:Help:Unified login|Read more about '''unified login''']]…''",
7787
@@ -146,32 +156,45 @@
147157 'centralauth-admin-delete-description' => 'Deleting the global account will delete any global preferences, unattach all local accounts, and leave the global name free for another user to take.
148158 All local accounts will continue to exist.
149159 The passwords for local accounts created before the merge will revert to their pre-merge values.',
150 - 'centralauth-admin-delete-button' => 'Delete this account',
151 - 'centralauth-admin-delete-success' => 'Successfully deleted the global account for "<nowiki>$1</nowiki>"',
152 - 'centralauth-admin-nonexistent' => 'There is no global account for "<nowiki>$1</nowiki>"',
153 - 'centralauth-admin-delete-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
154 - 'centralauth-token-mismatch' => 'Sorry, we could not process your form submission due to a loss of session data.',
155 - 'centralauth-admin-lock-title' => 'Lock account',
156 - 'centralauth-admin-lock-description' => 'Locking account will make impossible to log under it in any wiki.',
157 - 'centralauth-admin-lock-button' => 'Lock this account',
158 - 'centralauth-admin-lock-success' => 'Successfully locked the global account for "<nowiki>$1</nowiki>"',
159 - 'centralauth-admin-lock-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
160 - 'centralauth-admin-unlock-title' => 'Unlock account',
161 - 'centralauth-admin-unlock-description' => 'Unlocking account will make it possible again to log under it.',
162 - 'centralauth-admin-unlock-button' => 'Unlock this account',
163 - 'centralauth-admin-unlock-success' => 'Successfully unlocked the global account for "<nowiki>$1</nowiki>"',
164 - 'centralauth-admin-unlock-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
165 - 'centralauth-admin-hide-title' => 'Hide account',
166 - 'centralauth-admin-hide-description' => 'Hidden accounts are not shown on [[Special:GlobalUsers|Global users]].',
167 - 'centralauth-admin-hide-button' => 'Hide this account',
168 - 'centralauth-admin-hide-success' => 'Successfully hid the global account for "<nowiki>$1</nowiki>"',
169 - 'centralauth-admin-hide-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
170 - 'centralauth-admin-unhide-title' => 'Unhide account',
171 - 'centralauth-admin-unhide-description' => 'Unhiding account will make it again appear on [[Special:GlobalUsers|Global users]].',
172 - 'centralauth-admin-unhide-button' => 'Unhide this account',
173 - 'centralauth-admin-unhide-success' => 'Successfully unhid the global account for "<nowiki>$1</nowiki>"',
174 - 'centralauth-admin-unhide-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
175 - 'centralauth-admin-reason' => 'Reason:',
 160+ 'centralauth-admin-delete-button' => 'Delete this account',
 161+ 'centralauth-admin-delete-success' => 'Successfully deleted the global account for "<nowiki>$1</nowiki>"',
 162+ 'centralauth-admin-nonexistent' => 'There is no global account for "<nowiki>$1</nowiki>"',
 163+ 'centralauth-admin-delete-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
 164+ 'centralauth-token-mismatch' => 'Sorry, we could not process your form submission due to a loss of session data.',
 165+ 'centralauth-admin-lock-title' => 'Lock account',
 166+ 'centralauth-admin-lock-description' => 'Locking account will make impossible to log under it in any wiki.',
 167+ 'centralauth-admin-lock-button' => 'Lock this account',
 168+ 'centralauth-admin-lock-success' => 'Successfully locked the global account for "<nowiki>$1</nowiki>"',
 169+ 'centralauth-admin-lock-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
 170+ 'centralauth-admin-unlock-title' => 'Unlock account',
 171+ 'centralauth-admin-unlock-description' => 'Unlocking account will make it possible again to log under it.',
 172+ 'centralauth-admin-unlock-button' => 'Unlock this account',
 173+ 'centralauth-admin-unlock-success' => 'Successfully unlocked the global account for "<nowiki>$1</nowiki>"',
 174+ 'centralauth-admin-unlock-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
 175+ 'centralauth-admin-hide-title' => 'Hide account',
 176+ 'centralauth-admin-hide-description' => 'Hidden accounts are not shown on [[Special:GlobalUsers|Global users]].',
 177+ 'centralauth-admin-hide-button' => 'Hide this account',
 178+ 'centralauth-admin-hide-success' => 'Successfully hid the global account for "<nowiki>$1</nowiki>"',
 179+ 'centralauth-admin-hide-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
 180+ 'centralauth-admin-unhide-title' => 'Unhide account',
 181+ 'centralauth-admin-unhide-description' => 'Unhiding account will make it again appear on [[Special:GlobalUsers|Global users]].',
 182+ 'centralauth-admin-unhide-button' => 'Unhide this account',
 183+ 'centralauth-admin-unhide-success' => 'Successfully unhid the global account for "<nowiki>$1</nowiki>"',
 184+ 'centralauth-admin-unhide-nonexistent' => 'Error: the global account "<nowiki>$1</nowiki>" does not exist.',
 185+ 'centralauth-admin-block-title' => 'Block account',
 186+ 'centralauth-admin-block-description' => 'This forms allows you to block SUL account. Blocked SUL accounts will be still able to log in,
 187+but they will not be able to edit.',
 188+ 'centralauth-admin-block-button' => 'Block this account',
 189+ 'centralauth-admin-block-success' => 'Successfully blocked the global account for "<nowiki>$1</nowiki>"',
 190+ 'centralauth-admin-block-already' => 'Error: the global account "<nowiki>$1</nowiki>" is already blocked.',
 191+ 'centralauth-admin-block-badexpiry' => 'Error: bad expiry.',
 192+ 'centralauth-admin-unblock-title' => 'Unblock account',
 193+ 'centralauth-admin-unblock-description' => 'Unblocking account will make it possible again to edit under it.',
 194+ 'centralauth-admin-unblock-button' => 'Unblock this account',
 195+ 'centralauth-admin-unblock-success' => 'Successfully unblocked the global account for "<nowiki>$1</nowiki>"',
 196+ 'centralauth-admin-unblock-notblocked' => 'Error: the global account "<nowiki>$1</nowiki>" is not blocked.',
 197+ 'centralauth-admin-reason' => 'Reason:',
 198+ 'centralauth-admin-expiry' => 'Expiry:',
176199
177200 // List of global users
178201 'globalusers' => 'Global user list',
@@ -212,13 +235,15 @@
213236 'centralauth-logout-progress' => 'Logging you out from Wikimedia\'s other projects:',
214237
215238 // Logging
216 - 'centralauth-log-name' => 'Global account log',
217 - 'centralauth-log-header' => 'This log contains operations under global accounts: deletions, locking and unlocking.',
218 - 'centralauth-log-entry-delete' => 'deleted global account "<nowiki>$1</nowiki>"',
219 - 'centralauth-log-entry-lock' => 'locked global account "<nowiki>$1</nowiki>"',
220 - 'centralauth-log-entry-unlock' => 'unlocked global account "<nowiki>$1</nowiki>"',
221 - 'centralauth-log-entry-hide' => 'hid global account "<nowiki>$1</nowiki>"',
222 - 'centralauth-log-entry-unhide' => 'unhid global account "<nowiki>$1</nowiki>"',
 239+ 'centralauth-log-name' => 'Global account log',
 240+ 'centralauth-log-header' => 'This log contains operations under global accounts: deletions, locking and unlocking.',
 241+ 'centralauth-log-entry-delete' => 'deleted global account "<nowiki>$1</nowiki>"',
 242+ 'centralauth-log-entry-lock' => 'locked global account "<nowiki>$1</nowiki>"',
 243+ 'centralauth-log-entry-unlock' => 'unlocked global account "<nowiki>$1</nowiki>"',
 244+ 'centralauth-log-entry-hide' => 'hid global account "<nowiki>$1</nowiki>"',
 245+ 'centralauth-log-entry-unhide' => 'unhid global account "<nowiki>$1</nowiki>"',
 246+ 'centralauth-log-entry-block' => 'blocked global account "<nowiki>$1</nowiki>" with an expiry time of $2',
 247+ 'centralauth-log-entry-unblock' => 'unblocked global account "<nowiki>$1</nowiki>"',
223248
224249 'centralauth-rightslog-name' => 'Global rights log',
225250 'centralauth-rightslog-entry-usergroups' => 'changed global group membership for $1 from $2 to $3',

Follow-up revisions

RevisionCommit summaryAuthorDate
r35954Bump cached object revision due to change in r35928. Otherwise we get notice ...brion21:59, 5 June 2008
r35958Revert r35928 for now:...brion23:58, 5 June 2008

Status & tagging log