// Paranoia: avoid brute force searches (bug 17792)
if( !$wgUser->isAllowed( 'deletedhistory' ) ) {
$conds[] = $this->mDb->bitAnd('ar_deleted',Revision::DELETED_USER) . ' = 0';
- } else if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
+ } elseif( !$wgUser->isAllowed( 'suppressrevision' ) ) {
$conds[] = $this->mDb->bitAnd('ar_deleted',Revision::SUPPRESSED_USER) .
' != ' . Revision::SUPPRESSED_USER;
}
'tables' => array( 'archive' ),
'fields' => array(
'ar_rev_id', 'ar_namespace', 'ar_title', 'ar_timestamp', 'ar_comment', 'ar_minor_edit',
- 'ar_user', 'ar_user_text', 'ar_deleted'
+ 'ar_user', 'ar_user_text', 'ar_deleted', 'ar_len'
),
'conds' => $conds,
'options' => array( 'USE INDEX' => $index )
$condition = array();
$condition['ar_user_text'] = $this->target;
- $index = 'usertext_timestamp';
+ $index = array( 'archive' => 'ar_usertext_timestamp' );
return array( $index, $condition );
}
} else {
$mflag = '';
}
-
+
// Revision delete link
- $canHide = $wgUser->isAllowed( 'deleterevision' );
- if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) {
- if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
- $del = $this->mSkin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops
- } else {
- $query = array(
- 'type' => 'archive',
- 'target' => $page->getPrefixedDbkey(),
- 'ids' => $rev->getTimestamp() );
- $del = $this->mSkin->revDeleteLink( $query,
- $rev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ) . ' ';
- }
- } else {
- $del = '';
- }
+ $del = Linker::getRevDeleteLink( $wgUser, $rev, $page );
+ if ( $del ) $del .= ' ';
$tools = Html::rawElement(
'span',
array( 'class' => 'mw-deletedcontribs-tools' ),
wfMsg( 'parentheses', $wgLang->pipeList( array( $last, $dellog, $reviewlink ) ) )
);
-
- $ret = "{$del}{$link} {$tools} . . {$mflag} {$pagelink} {$comment}";
-
+
+ $diffOut = Linker::formatRevisionSize( $row->ar_len );
+ $ret = "{$del}{$link} {$tools} . . {$mflag} {$diffOut} {$pagelink} {$comment}";
+
# Denote if username is redacted for this edit
if( $rev->isDeleted( Revision::DELETED_USER ) ) {
$ret .= " <strong>" . wfMsgHtml('rev-deleted-user-contribs') . "</strong>";
return;
}
+ if( $wgUser->isBlocked() ){
+ throw new UserBlockedError( $wgUser->getBlock() );
+ }
+
global $wgOut, $wgRequest;
$wgOut->setPageTitle( wfMsgExt( 'deletedcontributions-title', array( 'parsemag' ) ) );
? 'sp-contributions-footer-anon'
: 'sp-contributions-footer';
-
- $text = wfMsgNoTrans( $message, $target );
- if( !wfEmptyMsg( $message, $text ) && $text != '-' ) {
+ if( !wfMessage( $message )->isDisabled() ) {
$wgOut->wrapWikiMsg( "<div class='mw-contributions-footer'>\n$1\n</div>", array( $message, $target ) );
}
}
* @param $nt Title object for the target
* @param $id Integer: User ID for the target
* @return String: appropriately-escaped HTML to be output literally
- * @todo Fixme: almost the same as contributionsSub in SpecialContributions.php. Could be combined.
+ * @todo FIXME: Almost the same as contributionsSub in SpecialContributions.php. Could be combined.
*/
function getSubTitle( $nt, $id ) {
- global $wgSysopUserBans, $wgLang, $wgUser, $wgOut;
+ global $wgLang, $wgUser, $wgOut;
- $sk = $wgUser->getSkin();
+ $sk = $this->getSkin();
if ( $id === null ) {
$user = htmlspecialchars( $nt->getText() );
if( $talk ) {
# Talk page link
$tools[] = $sk->link( $talk, wfMsgHtml( 'sp-contributions-talk' ) );
- if( ( $id !== null && $wgSysopUserBans ) || ( $id === null && IP::isIPAddress( $nt->getText() ) ) ) {
+ if( ( $id !== null ) || ( $id === null && IP::isIPAddress( $nt->getText() ) ) ) {
if( $wgUser->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
if ( $userObj->isBlocked() ) {
$tools[] = $sk->linkKnown( # Change block link
- SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
+ SpecialPage::getTitleFor( 'Block', $nt->getDBkey() ),
wfMsgHtml( 'change-blocklink' )
);
$tools[] = $sk->linkKnown( # Unblock link
array(),
array(
'action' => 'unblock',
- 'ip' => $nt->getDBkey()
+ 'ip' => $nt->getDBkey()
)
);
}
else { # User is not blocked
$tools[] = $sk->linkKnown( # Block link
- SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
+ SpecialPage::getTitleFor( 'Block', $nt->getDBkey() ),
wfMsgHtml( 'blocklink' )
);
}
// languages that want to put the "for" bit right after $user but before
// $links. If 'contribsub' is around, use it for reverse compatibility,
// otherwise use 'contribsub2'.
- if( wfEmptyMsg( 'contribsub', wfMsg( 'contribsub' ) ) ) {
+ if( wfEmptyMsg( 'contribsub' ) ) {
return wfMsgHtml( 'contribsub2', $user, $links );
} else {
return wfMsgHtml( 'contribsub', "$user ($links)" );