r56729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56728‎ | r56729 | r56730 >
Date:18:57, 21 September 2009
Author:werdna
Status:ok
Tags:
Comment:
Merge r56728 "Also check block status before allowing people to submit comments"
Modified paths:
  • /branches/wmf-deployment/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/CodeReview/ui/CodeRevisionView.php
@@ -76,7 +76,7 @@
7777
7878 $html = Xml::openElement( 'form', array( 'action' => $special->getLocalUrl(), 'method' => 'post' ) );
7979
80 - if ( $wgUser->isAllowed( 'codereview-post-comment' ) ) {
 80+ if ( $this->canPostComments() ) {
8181 $html .= $this->addActionButtons();
8282 }
8383
@@ -117,7 +117,7 @@
118118 "});</script>\n";
119119 }
120120
121 - if ( $wgUser->isAllowed( 'codereview-post-comment' ) ) {
 121+ if ( $this->canPostComments() ) {
122122 $html .= $this->addActionButtons();
123123 }
124124
@@ -177,6 +177,11 @@
178178 }
179179 return false;
180180 }
 181+
 182+ protected function canPostComments() {
 183+ global $wgUser;
 184+ return $wgUser->isAllowed( 'codereview-post-comment' ) && !$wgUser->isBlocked();
 185+ }
181186
182187 protected function formatPathLine( $path, $action ) {
183188 // Uses messages 'code-rev-modified-a', 'code-rev-modified-r', 'code-rev-modified-d', 'code-rev-modified-m'
@@ -578,7 +583,7 @@
579584
580585 protected function commentReplyLink( $id ) {
581586 global $wgUser;
582 - if ( !$wgUser->isAllowed( 'codereview-post-comment' ) ) return '';
 587+ if ( !$this->canPostComments() ) return '';
583588 $repo = $this->mRepo->getName();
584589 $rev = $this->mRev->getId();
585590 $self = SpecialPage::getTitleFor( 'Code', "$repo/$rev/reply/$id" );
@@ -597,7 +602,7 @@
598603 }
599604 $repo = $this->mRepo->getName();
600605 $rev = $this->mRev->getId();
601 - if ( !$wgUser->isAllowed( 'codereview-post-comment' ) ) {
 606+ if ( !$this->canPostComments() ) {
602607 return '';
603608 }
604609 return '<div class="mw-codereview-post-comment">' .
Property changes on: branches/wmf-deployment/extensions/CodeReview/ui/CodeRevisionView.php
___________________________________________________________________
Name: svn:mergeinfo
605610 + /branches/REL1_15/phase3/extensions/CodeReview/ui/CodeRevisionView.php:51646
/trunk/extensions/CodeReview/ui/CodeRevisionView.php:56207,56209,56296,56333,56355,56728
/trunk/phase3/extensions/CodeReview/ui/CodeRevisionView.php:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56728Also check block status before allowing people to submit commentsdemon18:44, 21 September 2009

Status & tagging log