r113804 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113803‎ | r113804 | r113805 >
Date:10:46, 14 March 2012
Author:ialex
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -261,7 +261,7 @@
262262 $samePage = false;
263263 }
264264
265 - if ( $samePage && $this->mNewPage->userCan( 'edit', $user ) ) {
 265+ if ( $samePage && $this->mNewPage->quickUserCan( 'edit', $user ) ) {
266266 if ( $this->mNewRev->isCurrent() && $this->mNewPage->userCan( 'rollback', $user ) ) {
267267 $out->preventClickjacking();
268268 $rollback = '   ' . Linker::generateRollback( $this->mNewRev );
@@ -403,7 +403,7 @@
404404
405405 if ( $this->mMarkPatrolledLink === null ) {
406406 // Prepare a change patrol link, if applicable
407 - if ( $wgUseRCPatrol && $this->mNewPage->userCan( 'patrol', $this->getUser() ) ) {
 407+ if ( $wgUseRCPatrol && $this->mNewPage->quickUserCan( 'patrol', $this->getUser() ) ) {
408408 // If we've been given an explicit change identifier, use it; saves time
409409 if ( $this->mRcidMarkPatrolled ) {
410410 $rcid = $this->mRcidMarkPatrolled;
@@ -867,7 +867,7 @@
868868 $editQuery['oldid'] = $rev->getID();
869869 }
870870
871 - $msg = $this->msg( $title->userCan( 'edit', $user ) ? 'editold' : 'viewsourceold' )->escaped();
 871+ $msg = $this->msg( $title->quickUserCan( 'edit', $user ) ? 'editold' : 'viewsourceold' )->escaped();
872872 $header .= ' (' . Linker::linkKnown( $title, $msg, array(), $editQuery ) . ')';
873873 if ( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
874874 $header = Html::rawElement( 'span', array( 'class' => 'history-deleted' ), $header );

Status & tagging log