X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialDeletedContributions.php;h=3e1f7bc24002b7550254390757a84f2e6a5c0ce0;hb=55669ae0ccc26611c8c0dd8c7f0fb9d3845cdae7;hp=3ac6b79b70788924487841d31571778c3042ef98;hpb=a2462d8fcd4a5cf454da040a7d3de9d4b99a65b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 3ac6b79b70..3e1f7bc240 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -11,7 +11,7 @@ class DeletedContribsPager extends IndexPager { function __construct( $target, $namespace = false ) { parent::__construct(); - foreach( explode( ' ', 'deletionlog undeletebtn minoreditletter diff' ) as $msg ) { + foreach( explode( ' ', 'deletionlog undeleteviewlink diff' ) as $msg ) { $this->messages[$msg] = wfMsgExt( $msg, array( 'escape') ); } $this->target = $target; @@ -30,8 +30,11 @@ class DeletedContribsPager extends IndexPager { list( $index, $userCond ) = $this->getUserCond(); $conds = array_merge( $userCond, $this->getNamespaceCond() ); // Paranoia: avoid brute force searches (bug 17792) - if( !$wgUser->isAllowed( 'suppressrevision' ) ) { - $conds[] = $this->mDb->bitAnd('ar_deleted', Revision::DELETED_USER) . ' = 0'; + if( !$wgUser->isAllowed( 'deleterevision' ) ) { + $conds[] = $this->mDb->bitAnd('ar_deleted',Revision::DELETED_USER) . ' = 0'; + } else if( !$wgUser->isAllowed( 'suppressrevision' ) ) { + $conds[] = $this->mDb->bitAnd('ar_deleted',Revision::SUPPRESSED_USER) . + ' != ' . Revision::SUPPRESSED_USER; } return array( 'tables' => array( 'archive' ), @@ -139,39 +142,33 @@ class DeletedContribsPager extends IndexPager { $reviewlink = $sk->linkKnown( SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ), - $this->messages['undeletebtn'] + $this->messages['undeleteviewlink'] ); - $link = $sk->linkKnown( - $undelete, - htmlspecialchars( $page->getPrefixedText() ), - array(), - array( - 'target' => $page->getPrefixedText(), - 'timestamp' => $rev->getTimestamp() - ) - ); - - $last = $sk->linkKnown( - $undelete, - $this->messages['diff'], - array(), - array( - 'target' => $page->getPrefixedText(), - 'timestamp' => $rev->getTimestamp(), - 'diff' => 'prev' - ) - ); + if( $wgUser->isAllowed('undelete') ) { + $last = $sk->linkKnown( + $undelete, + $this->messages['diff'], + array(), + array( + 'target' => $page->getPrefixedText(), + 'timestamp' => $rev->getTimestamp(), + 'diff' => 'prev' + ) + ); + } else { + $last = $this->messages['diff']; + } $comment = $sk->revComment( $rev ); - $d = htmlspecialchars( $wgLang->timeanddate( $rev->getTimestamp(), true ) ); + $date = htmlspecialchars( $wgLang->timeanddate( $rev->getTimestamp(), true ) ); - if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { - $d = '' . $d . ''; + if( !$wgUser->isAllowed('undelete') || !$rev->userCan(Revision::DELETED_TEXT) ) { + $link = $date; // unusable link } else { $link = $sk->linkKnown( $undelete, - $d, + $date, array(), array( 'target' => $page->getPrefixedText(), @@ -179,11 +176,15 @@ class DeletedContribsPager extends IndexPager { ) ); } + // Style deleted items + if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { + $link = '' . $link . ''; + } $pagelink = $sk->link( $page ); if( $rev->isMinor() ) { - $mflag = '' . $this->messages['minoreditletter'] . ' '; + $mflag = ChangesList::flag( 'minor' ); } else { $mflag = ''; }