Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | |
78 | 78 | $html = Xml::openElement( 'form', array( 'action' => $special->getLocalUrl(), 'method' => 'post' ) ); |
79 | 79 | |
80 | | - if ( $wgUser->isAllowed( 'codereview-post-comment' ) ) { |
| 80 | + if ( $this->canPostComments() ) { |
81 | 81 | $html .= $this->addActionButtons(); |
82 | 82 | } |
83 | 83 | |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | "});</script>\n"; |
119 | 119 | } |
120 | 120 | |
121 | | - if ( $wgUser->isAllowed( 'codereview-post-comment' ) ) { |
| 121 | + if ( $this->canPostComments() ) { |
122 | 122 | $html .= $this->addActionButtons(); |
123 | 123 | } |
124 | 124 | |
— | — | @@ -177,6 +177,11 @@ |
178 | 178 | } |
179 | 179 | return false; |
180 | 180 | } |
| 181 | + |
| 182 | + protected function canPostComments() { |
| 183 | + global $wgUser; |
| 184 | + return $wgUser->isAllowed( 'codereview-post-comment' ) && !$wgUser->isBlocked(); |
| 185 | + } |
181 | 186 | |
182 | 187 | protected function formatPathLine( $path, $action ) { |
183 | 188 | // Uses messages 'code-rev-modified-a', 'code-rev-modified-r', 'code-rev-modified-d', 'code-rev-modified-m' |
— | — | @@ -578,7 +583,7 @@ |
579 | 584 | |
580 | 585 | protected function commentReplyLink( $id ) { |
581 | 586 | global $wgUser; |
582 | | - if ( !$wgUser->isAllowed( 'codereview-post-comment' ) ) return ''; |
| 587 | + if ( !$this->canPostComments() ) return ''; |
583 | 588 | $repo = $this->mRepo->getName(); |
584 | 589 | $rev = $this->mRev->getId(); |
585 | 590 | $self = SpecialPage::getTitleFor( 'Code', "$repo/$rev/reply/$id" ); |
— | — | @@ -597,7 +602,7 @@ |
598 | 603 | } |
599 | 604 | $repo = $this->mRepo->getName(); |
600 | 605 | $rev = $this->mRev->getId(); |
601 | | - if ( !$wgUser->isAllowed( 'codereview-post-comment' ) ) { |
| 606 | + if ( !$this->canPostComments() ) { |
602 | 607 | return ''; |
603 | 608 | } |
604 | 609 | return '<div class="mw-codereview-post-comment">' . |