From: Alexandre Emsenhuber Date: Wed, 14 Mar 2012 10:46:59 +0000 (+0000) Subject: Be consistent in the interface and use Title::quickUserCan() instead of Title::userCa... X-Git-Tag: 1.31.0-rc.0~24260 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=f23a4e1f84a089e72b84274b1636ce6de62c364f;p=lhc%2Fweb%2Fwiklou.git Be consistent in the interface and use Title::quickUserCan() instead of Title::userCan() to show items in the interface so that when the user is blocked or the page is cascade protected there is not a part of the interface saying you can edit the page and another part not. --- diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 39e555e6fe..f1bee3c5b7 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -261,7 +261,7 @@ class DifferenceEngine extends ContextSource { $samePage = false; } - if ( $samePage && $this->mNewPage->userCan( 'edit', $user ) ) { + if ( $samePage && $this->mNewPage->quickUserCan( 'edit', $user ) ) { if ( $this->mNewRev->isCurrent() && $this->mNewPage->userCan( 'rollback', $user ) ) { $out->preventClickjacking(); $rollback = '   ' . Linker::generateRollback( $this->mNewRev ); @@ -403,7 +403,7 @@ class DifferenceEngine extends ContextSource { if ( $this->mMarkPatrolledLink === null ) { // Prepare a change patrol link, if applicable - if ( $wgUseRCPatrol && $this->mNewPage->userCan( 'patrol', $this->getUser() ) ) { + if ( $wgUseRCPatrol && $this->mNewPage->quickUserCan( 'patrol', $this->getUser() ) ) { // If we've been given an explicit change identifier, use it; saves time if ( $this->mRcidMarkPatrolled ) { $rcid = $this->mRcidMarkPatrolled; @@ -867,7 +867,7 @@ class DifferenceEngine extends ContextSource { $editQuery['oldid'] = $rev->getID(); } - $msg = $this->msg( $title->userCan( 'edit', $user ) ? 'editold' : 'viewsourceold' )->escaped(); + $msg = $this->msg( $title->quickUserCan( 'edit', $user ) ? 'editold' : 'viewsourceold' )->escaped(); $header .= ' (' . Linker::linkKnown( $title, $msg, array(), $editQuery ) . ')'; if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $header = Html::rawElement( 'span', array( 'class' => 'history-deleted' ), $header );