r56728 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56727‎ | r56728 | r56729 >
Date:18:44, 21 September 2009
Author:demon
Status:ok (Comments)
Tags:
Comment:
Also check block status before allowing people to submit comments
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/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">' .

Follow-up revisions

RevisionCommit summaryAuthorDate
r56729Merge r56728 "Also check block status before allowing people to submit comments"werdna18:57, 21 September 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   22:36, 30 September 2009

good catch :D

Status & tagging log