{
/* public*/ var $mAddress, $mUser, $mBy, $mReason, $mTimestamp, $mAuto, $mId, $mExpiry,
$mRangeStart, $mRangeEnd, $mAnonOnly, $mEnableAutoblock, $mHideName,
- $mBlockEmail;
- /* private */ var $mNetworkBits, $mIntegerAddr, $mForUpdate, $mFromMaster, $mByName;
+ $mBlockEmail, $mByName;
+ /* private */ var $mNetworkBits, $mIntegerAddr, $mForUpdate, $mFromMaster;
const EB_KEEP_EXPIRED = 1;
const EB_FOR_UPDATE = 2;
if ( isset( $row->user_name ) ) {
$this->mByName = $row->user_name;
} else {
- $this->mByName = false;
+ $this->mByName = $row->ipb_by_text;
}
$this->mRangeStart = $row->ipb_range_start;
$this->mRangeEnd = $row->ipb_range_end;
$this->mBlockEmail = 0; //Same goes for email...
}
+ if( !$this->mByName ) {
+ if( $this->mBy ) {
+ $this->mByName = User::whoIs( $this->mBy );
+ } else {
+ global $wgUser;
+ $this->mByName = $wgUser->getName();
+ }
+ }
+
# Don't collide with expired blocks
Block::purgeExpired();
'ipb_address' => $this->mAddress,
'ipb_user' => $this->mUser,
'ipb_by' => $this->mBy,
+ 'ipb_by_text' => $this->mByName,
'ipb_reason' => $this->mReason,
'ipb_timestamp' => $dbw->timestamp($this->mTimestamp),
'ipb_auto' => $this->mAuto,
*/
function getByName()
{
- if ( $this->mByName === false ) {
- $this->mByName = User::whoIs( $this->mBy );
- }
return $this->mByName;
}
# Usernames and titles are in fact related by a simple substitution of space -> underscore
# The last few lines of Title::secureAndSplit() tell the story.
while ( $row = $this->mResult->fetchObject() ) {
- $name = str_replace( ' ', '_', $row->user_name );
+ $name = str_replace( ' ', '_', $row->ipb_by_text );
$lb->add( NS_USER, $name );
$lb->add( NS_USER_TALK, $name );
$name = str_replace( ' ', '_', $row->ipb_address );
function getQueryInfo() {
$conds = $this->mConds;
$conds[] = 'ipb_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() );
- $conds[] = 'ipb_by=user_id';
return array(
- 'tables' => array( 'ipblocks', 'user' ),
- 'fields' => $this->mDb->tableName( 'ipblocks' ) . '.*,user_name',
+ 'tables' => 'ipblocks',
+ 'fields' => '*',
'conds' => $conds,
);
}
$wgNewTables = array(
# table patch file (in maintenance/archives)
- array( 'hitcounter', 'patch-hitcounter.sql' ),
- array( 'querycache', 'patch-querycache.sql' ),
- array( 'objectcache', 'patch-objectcache.sql' ),
- array( 'categorylinks', 'patch-categorylinks.sql' ),
- array( 'logging', 'patch-logging.sql' ),
- array( 'user_newtalk', 'patch-usernewtalk2.sql' ),
- array( 'transcache', 'patch-transcache.sql' ),
- array( 'trackbacks', 'patch-trackbacks.sql' ),
- array( 'externallinks', 'patch-externallinks.sql' ),
- array( 'job', 'patch-job.sql' ),
- array( 'langlinks', 'patch-langlinks.sql' ),
- array( 'querycache_info', 'patch-querycacheinfo.sql' ),
- array( 'filearchive', 'patch-filearchive.sql' ),
- array( 'querycachetwo', 'patch-querycachetwo.sql' ),
- array( 'redirect', 'patch-redirect.sql' ),
+ array( 'hitcounter', 'patch-hitcounter.sql' ),
+ array( 'querycache', 'patch-querycache.sql' ),
+ array( 'objectcache', 'patch-objectcache.sql' ),
+ array( 'categorylinks', 'patch-categorylinks.sql' ),
+ array( 'logging', 'patch-logging.sql' ),
+ array( 'user_newtalk', 'patch-usernewtalk2.sql' ),
+ array( 'transcache', 'patch-transcache.sql' ),
+ array( 'trackbacks', 'patch-trackbacks.sql' ),
+ array( 'externallinks', 'patch-externallinks.sql' ),
+ array( 'job', 'patch-job.sql' ),
+ array( 'langlinks', 'patch-langlinks.sql' ),
+ array( 'querycache_info', 'patch-querycacheinfo.sql' ),
+ array( 'filearchive', 'patch-filearchive.sql' ),
+ array( 'querycachetwo', 'patch-querycachetwo.sql' ),
+ array( 'redirect', 'patch-redirect.sql' ),
array( 'protected_titles', 'patch-protected_titles.sql' ),
);
array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql'),
array( 'archive', 'ar_page_id', 'patch-archive-page_id.sql'),
array( 'image', 'img_sha1', 'patch-img_sha1.sql' ),
+ array( 'ipblocks', 'ipb_by_text', 'patch-ipb_by_text.sql' ),
);
# For extensions only, should be populated via hooks