r16300 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16299‎ | r16300 | r16301 >
Date:15:15, 31 August 2006
Author:tstarling
Status:old
Tags:
Comment:
access checks, start date checks
Modified paths:
  • /trunk/extensions/BoardVote/BoardVote.i18n.php (modified) (history)
  • /trunk/extensions/BoardVote/BoardVote_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/BoardVote/BoardVote_body.php
@@ -21,7 +21,7 @@
2222
2323 function execute( $par ) {
2424 global $wgUser, $wgDBname, $wgInputEncoding, $wgRequest,
25 - $wgBoardVoteEditCount, $wgBoardVoteEndDate;
 25+ $wgBoardVoteEditCount, $wgBoardVoteEndDate, $wgBoardVoteStartDate;
2626
2727 $this->mUserKey = iconv( $wgInputEncoding, "UTF-8", $wgUser->getName() ) . "@$wgDBname";
2828 $this->mPosted = $wgRequest->wasPosted();
@@ -42,15 +42,29 @@
4343
4444 $this->setHeaders();
4545
 46+ global $wgOut;
 47+
 48+ if ( wfTimestampNow() < $wgBoardVoteStartDate && !$this->isAdmin() ) {
 49+ $wgOut->addWikiText( wfMsg( 'boardvote_notstarted' ) );
 50+ return;
 51+ }
 52+
 53+ if ( $wgUser->isBlocked() ) {
 54+ $wgOut->blockedPage();
 55+ return;
 56+ }
 57+
4658 if ( wfTimestampNow() > $wgBoardVoteEndDate ) {
4759 $this->mFinished = true;
4860 } else {
4961 $this->mFinished = false;
5062 }
5163
52 - global $wgOut;
53 - $wgOut->addWikiText( wfMsg( 'boardvote_closed' ) );
5464
 65+ if ( $this->mFinished ) {
 66+ $wgOut->addWikiText( wfMsg( 'boardvote_closed' ) );
 67+ }
 68+
5569 if ( $this->mAction == "list" ) {
5670 $this->displayList();
5771 } elseif ( $this->mAction == "dump" ) {
Index: trunk/extensions/BoardVote/BoardVote.i18n.php
@@ -69,6 +69,7 @@
7070 'boardvote_unstrike' => "Unstrike",
7171 'boardvote_needadmin' => "Only election administrators can perform this operation.",
7272 'boardvote_sitenotice' => "<a href=\"{{localurle:Special:Boardvote/vote}}\">Wikimedia Board Elections</a>: Vote open until July 12",
 73+ 'boardvote_notstarted' => 'Voting has not yet started',
7374 'boardvote_closed' => 'Voting is now closed, see [http://meta.wikimedia.org/wiki/Elections_for_the_Board_of_Trustees_of_the_Wikimedia_Foundation%2C_2006/En the elections page for results] soon.',
7475 'boardvote_edits_many' => 'many',
7576 'group-boardvote' => 'Board vote admins',