r45639 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45638‎ | r45639 | r45640 >
Date:15:48, 10 January 2009
Author:ashley
Status:ok
Tags:
Comment:
BoardVote cleanup:
*addWikiText(wfMsg()) => addWikiMsg() whenever possible
*remove php ending tag from voterList.php maintenance script
*add authors per http://www.mediawiki.org/wiki/Extension:BoardVote
*use database class functions instead of raw sql
*double quotes => single quotes where possible
*removed a few unused globals
*change special page name to camelcase "BoardVote" from "Boardvote"
*doxygen doc tweaks
*spacing tweaks
*__METHOD__ instead of manual $fname declarations
*mark visibility of some functions
Modified paths:
  • /trunk/extensions/BoardVote/BoardVote.alias.php (modified) (history)
  • /trunk/extensions/BoardVote/BoardVote.i18n.php (modified) (history)
  • /trunk/extensions/BoardVote/BoardVote.php (modified) (history)
  • /trunk/extensions/BoardVote/BoardVote_body.php (modified) (history)
  • /trunk/extensions/BoardVote/GoToBoardVote_body.php (modified) (history)
  • /trunk/extensions/BoardVote/voterList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/BoardVote/GoToBoardVote_body.php
@@ -1,14 +1,23 @@
22 <?php
3 -if (!defined('MEDIAWIKI')) {
 3+if( !defined('MEDIAWIKI') ) {
44 die( "Not a valid entry point\n" );
55 }
66
77 class GoToBoardVotePage extends SpecialPage {
8 - function __construct() {
9 - parent::__construct( "Boardvote" );
 8+
 9+ /**
 10+ * Constructor
 11+ */
 12+ public function __construct() {
 13+ parent::__construct( 'BoardVote' );
1014 }
1115
12 - function execute( $par ) {
 16+ /**
 17+ * Show the special page
 18+ *
 19+ * @param $par Mixed: parameter passed to the page or null
 20+ */
 21+ public function execute( $par ) {
1322 global $wgOut, $wgDBname, $site, $lang, $wgLang, $wgUser;
1423 global $wgBoardVoteEditCount, $wgBoardVoteRecentEditCount, $wgBoardVoteCountDate;
1524 global $wgBoardVoteRecentFirstCountDate, $wgBoardVoteRecentCountDate;
@@ -21,8 +30,7 @@
2231 if ( class_exists( 'CentralAuthUser' ) ) {
2332 global $wgCentralAuthCookiePrefix;
2433 if ( isset( $wgCentralAuthCookiePrefix )
25 - && isset( $_COOKIE[$wgCentralAuthCookiePrefix . 'Session'] ) )
26 - {
 34+ && isset( $_COOKIE[$wgCentralAuthCookiePrefix . 'Session'] ) ) {
2735 $centralSessionId = $_COOKIE[$wgCentralAuthCookiePrefix . 'Session'];
2836 } elseif ( isset( $_COOKIE[$wgCentralAuthCookiePrefix . 'Token'] ) ) {
2937 $centralUser = CentralAuthUser::getInstance( $wgUser );
@@ -33,7 +41,7 @@
3442 if ( $wgUser->isLoggedIn() ) {
3543 #$url = 'http://shimmer/farm/frwiki/index.php?' . wfArrayToCGI( array(
3644 $url = 'https://wikimedia.spi-inc.org/index.php?' . wfArrayToCGI( array(
37 - 'title' => 'Special:Boardvote' . ( $par ? "/$par" : '' ),
 45+ 'title' => 'Special:BoardVote' . ( $par ? "/$par" : '' ),
3846 'sid' => session_id(),
3947 'casid' => $centralSessionId,
4048 'db' => $wgDBname,
@@ -42,7 +50,7 @@
4351 'uselang' => $wgLang->getCode()
4452 ) );
4553
46 - $wgOut->addWikiText( wfMsg( "boardvote_redirecting", $url ) );
 54+ $wgOut->addWikiMsg( 'boardvote_redirecting', $url );
4755 $wgOut->addMeta( 'http:Refresh', '20;url=' . htmlspecialchars( $url ) );
4856 } else {
4957 $wgOut->addWikiText( wfMsgExt( 'boardvote_notloggedin', array( 'parsemag' ), $wgBoardVoteEditCount,
Index: trunk/extensions/BoardVote/voterList.php
@@ -51,6 +51,4 @@
5252 "$email\t$editCount\t$props\n" );
5353 }
5454 }
55 -fclose( $listFile );
56 -
57 -?>
 55+fclose( $listFile );
\ No newline at end of file
Index: trunk/extensions/BoardVote/BoardVote.alias.php
@@ -2,7 +2,8 @@
33 /**
44 * Aliases for Special:BoardVote
55 *
6 - * @addtogroup Extensions
 6+ * @file
 7+ * @ingroup Extensions
78 */
89
910 $aliases = array();
Index: trunk/extensions/BoardVote/BoardVote_body.php
@@ -1,5 +1,5 @@
22 <?php
3 -if (!defined('MEDIAWIKI')) {
 3+if( !defined('MEDIAWIKI') ) {
44 die( "Not a valid entry point\n" );
55 }
66
@@ -8,8 +8,11 @@
99 var $mHasVoted, $mAction, $mUserKey, $mId, $mFinished;
1010 var $mDb;
1111
12 - function __construct() {
13 - parent::__construct( "Boardvote" );
 12+ /**
 13+ * Constructor
 14+ */
 15+ public function __construct() {
 16+ parent::__construct( 'BoardVote' );
1417 }
1518
1619 function getUserFromRemote( $sid, $casid, $db, $site, $lang ) {
@@ -113,11 +116,11 @@
114117
115118 $this->mPosted = $wgRequest->wasPosted();
116119 if ( method_exists( $wgRequest, 'getArray' ) ) {
117 - $this->mVotedFor = $wgRequest->getArray( "candidate", array() );
 120+ $this->mVotedFor = $wgRequest->getArray( 'candidate', array() );
118121 } else {
119 - $this->mVotedFor = $wgRequest->getVal( "candidate", array() );
 122+ $this->mVotedFor = $wgRequest->getVal( 'candidate', array() );
120123 }
121 - $this->mId = $wgRequest->getInt( "id", 0 );
 124+ $this->mId = $wgRequest->getInt( 'id', 0 );
122125 $this->mValidVote = $this->mPosted ? $this->validVote() : false;
123126
124127 $this->mHasVoted = $this->hasVoted();
@@ -125,12 +128,16 @@
126129 if ( $par ) {
127130 $this->mAction = $par;
128131 } else {
129 - $this->mAction = $wgRequest->getText( "action" );
 132+ $this->mAction = $wgRequest->getText( 'action' );
130133 }
131134 }
132135
133 -
134 - function execute( $par ) {
 136+ /**
 137+ * Show the special page
 138+ *
 139+ * @param $par Mixed: parameter passed to the page or null
 140+ */
 141+ public function execute( $par ) {
135142 global $wgOut, $wgBoardVoteStartDate, $wgBoardVoteEndDate;
136143
137144 wfLoadExtensionMessages( 'BoardVote' );
@@ -144,28 +151,27 @@
145152 }
146153
147154 if ( $this->mUserKey ) {
148 - $wgOut->addWikiText( wfMsg( 'boardvote_welcome', wfEscapeWikiText( $this->mUserKey ) ) );
 155+ $wgOut->addWikiMsg( 'boardvote_welcome', wfEscapeWikiText( $this->mUserKey ) );
149156 }
150157
151158 if ( wfTimestampNow() < $wgBoardVoteStartDate && !$this->isAdmin() ) {
152 - $wgOut->addWikiText( wfMsg( 'boardvote_notstarted' ) );
 159+ $wgOut->addWikiMsg( 'boardvote_notstarted' );
153160 return;
154161 }
155162
156163 if ( $this->mBlocked ) {
157 - $wgOut->addWikiText( wfMsg( 'boardvote_blocked' ) );
 164+ $wgOut->addWikiMsg( 'boardvote_blocked' );
158165 return;
159166 }
160167
161168 if ( $this->mBot ) {
162 - $wgOut->addWikiText( wfMsg( 'boardvote_bot' ) );
 169+ $wgOut->addWikiMsg( 'boardvote_bot' );
163170 return;
164171 }
165172
166173 if ( wfTimestampNow() > $wgBoardVoteEndDate ) {
167174 $this->mFinished = true;
168 -
169 - $wgOut->addWikiText( wfMsg( 'boardvote_closed' ) );
 175+ $wgOut->addWikiMsg( 'boardvote_closed' );
170176 } else {
171177 $this->mFinished = false;
172178 }
@@ -202,7 +208,7 @@
203209
204210 function displayEntry() {
205211 global $wgOut;
206 - $wgOut->addWikiText( wfMsg( "boardvote_entry" ) );
 212+ $wgOut->addWikiMsg( 'boardvote_entry' );
207213 }
208214
209215 function getDB() {
@@ -212,8 +218,8 @@
213219 $this->mDb = new Database( $wgBoardVoteDBServer, $wgDBuser, $wgDBpassword,
214220 $wgBoardVoteDB, /*failfn*/false, /*flags*/0, /*prefix*/'' );
215221 if ( !$this->mDb->isOpen() ) {
216 - // This should be handled inside the constructor, but we'll check just in case
217 - throw new MWException( "DB connection failed unexpectedly" );
 222+ // This should be handled inside the constructor, but we'll check just in case
 223+ throw new MWException( "DB connection failed unexpectedly" );
218224 }
219225 }
220226 return $this->mDb;
@@ -222,7 +228,7 @@
223229 function hasVoted() {
224230 $dbr =& $this->getDB();
225231 $row = $dbr->selectRow( 'vote_log', array( "1" ),
226 - array( "log_user_key" => $this->mUserKey ), "BoardVotePage::getUserVote" );
 232+ array( 'log_user_key' => $this->mUserKey ), __METHOD__ );
227233 if ( $row === false ) {
228234 return false;
229235 } else {
@@ -232,19 +238,16 @@
233239
234240 function logVote() {
235241 global $wgUser, $wgDBname, $wgOut, $wgGPGPubKey, $wgRequest;
236 - $fname = "BoardVotePage::logVote";
237242
238243 $now = wfTimestampNow();
239244 $record = $this->getRecord();
240245 $encrypted = $this->encrypt( $record );
241246 $gpgKey = file_get_contents( $wgGPGPubKey );
242247 $dbw =& $this->getDB();
243 - $log = $dbw->tableName( "vote_log" );
244248
245249 # Mark previous votes as old
246250 $encKey = $dbw->strencode( $this->mUserKey );
247 - $sql = "UPDATE $log SET log_current=0 WHERE log_user_key='$encKey'";
248 - $dbw->query( $sql, $fname );
 251+ $dbw->update( 'vote_log', array( 'log_current' => 0 ), array( 'log_user_key' => $encKey ), __METHOD__ );
249252
250253 # Add vote to log
251254 $xff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
@@ -254,42 +257,42 @@
255258
256259 $tokenMatch = $wgUser->matchEditToken( $wgRequest->getVal( 'edit_token' ) );
257260
258 - $dbw->insert( $log, array(
259 - "log_user" => 0,
260 - "log_user_text" => '',
261 - "log_user_key" => $this->mUserKey,
262 - "log_wiki" => $wgDBname,
263 - "log_record" => $encrypted,
264 - "log_ip" => wfGetIP(),
265 - "log_xff" => $xff,
266 - "log_ua" => $_SERVER['HTTP_USER_AGENT'],
267 - "log_timestamp" => $now,
268 - "log_current" => 1,
269 - "log_token_match" => $tokenMatch ? 1 : 0,
270 - ), $fname );
 261+ $dbw->insert( 'vote_log', array(
 262+ 'log_user' => 0,
 263+ 'log_user_text' => '',
 264+ 'log_user_key' => $this->mUserKey,
 265+ 'log_wiki' => $wgDBname,
 266+ 'log_record' => $encrypted,
 267+ 'log_ip' => wfGetIP(),
 268+ 'log_xff' => $xff,
 269+ 'log_ua' => $_SERVER['HTTP_USER_AGENT'],
 270+ 'log_timestamp' => $now,
 271+ 'log_current' => 1,
 272+ 'log_token_match' => $tokenMatch ? 1 : 0,
 273+ ), __METHOD__ );
271274
272 - $wgOut->addWikiText( wfMsg( "boardvote_entered", $record, $gpgKey, $encrypted ) );
 275+ $wgOut->addWikiMsg( 'boardvote_entered', $record, $gpgKey, $encrypted );
273276 }
274277
275278 function displayVote() {
276279 global $wgBoardCandidates, $wgOut;
277280
278 - $thisTitle = Title::makeTitle( NS_SPECIAL, "Boardvote" );
 281+ $thisTitle = SpecialPage::getTitleFor( 'BoardVote' );
279282 $action = $thisTitle->escapeLocalURL( "action=vote" );
280283 if ( $this->mHasVoted ) {
281 - $intro = wfMsg( "boardvote_intro_change" );
 284+ $intro = wfMsg( 'boardvote_intro_change' );
282285 } else {
283 - $intro = wfMsg( "boardvote_intro" );
 286+ $intro = wfMsg( 'boardvote_intro' );
284287 }
285288
286 - $ok = wfMsgHtml( "boardvote_submit" );
 289+ $ok = wfMsgHtml( 'boardvote_submit' );
287290
288291 $candidates = array();
289292 foreach( $wgBoardCandidates as $i => $candidate ) {
290293 $candidates[] = array( $i, $candidate );
291294 }
292295
293 - srand ((float)microtime()*1000000);
 296+ srand( (float)microtime() * 1000000 );
294297 shuffle( $candidates );
295298
296299 $text = "
@@ -306,7 +309,7 @@
307310 <td><input name=\"submit\" type=\"submit\" value=\"$ok\">
308311 <input type='hidden' name='edit_token' value=\"{$token}\" /></td>
309312 </tr></table></form>";
310 - $text .= wfMsg( "boardvote_footer" );
 313+ $text .= wfMsg( 'boardvote_footer' );
311314 $wgOut->addHTML( $text );
312315 }
313316
@@ -343,7 +346,7 @@
344347
345348 function displayInvalidVoteError() {
346349 global $wgOut;
347 - $wgOut->addWikiText( wfMsg( "boardvote_invalidentered" ) );
 350+ $wgOut->addWikiMsg( 'boardvote_invalidentered' );
348351 }
349352
350353 function getRecord() {
@@ -417,28 +420,26 @@
418421 }
419422
420423 function displayList() {
421 - global $wgOut, $wgOutputEncoding, $wgLang, $wgUser;
 424+ global $wgOut, $wgLang, $wgUser;
422425
423426 $userRights = $wgUser->getRights();
424427 $admin = $this->isAdmin();
425428 $dbr =& $this->getDB();
426 - $log = $dbr->tableName( "vote_log" );
427429
428 - $sql = "SELECT * FROM $log ORDER BY log_user_key";
429 - $res = $dbr->query( $sql, "BoardVotePage::list" );
 430+ $res = $dbr->select( 'vote_log', '*', array(), __METHOD__, array( 'ORDER BY' => 'log_user_key' ) );
430431 if ( $dbr->numRows( $res ) == 0 ) {
431 - $wgOut->addWikiText( wfMsg( "boardvote_novotes" ) );
 432+ $wgOut->addWikiMsg( 'boardvote_novotes' );
432433 return;
433434 }
434 - $thisTitle = Title::makeTitle( NS_SPECIAL, "Boardvote" );
 435+ $thisTitle = SpecialPage::getTitleFor( 'BoardVote' );
435436 $sk = $wgUser->getSkin();
436 - $dumpLink = $sk->makeKnownLinkObj( $thisTitle, wfMsg( "boardvote_dumplink" ), "action=dump" );
 437+ $dumpLink = $sk->makeKnownLinkObj( $thisTitle, wfMsg( 'boardvote_dumplink' ), "action=dump" );
437438
438 - $intro = wfMsg( "boardvote_listintro", $dumpLink );
439 - $hTime = wfMsg( "boardvote_time" );
440 - $hUser = wfMsg( "boardvote_user" );
441 - $hIp = wfMsg( "boardvote_ip" );
442 - $hUa = wfMsg( "boardvote_ua" );
 439+ $intro = wfMsg( 'boardvote_listintro', $dumpLink );
 440+ $hTime = wfMsg( 'boardvote_time' );
 441+ $hUser = wfMsg( 'boardvote_user' );
 442+ $hIp = wfMsg( 'boardvote_ip' );
 443+ $hUa = wfMsg( 'boardvote_ua' );
443444
444445 $s = "$intro <table border=1><tr><th>
445446 $hUser
@@ -476,10 +477,10 @@
477478
478479 if ( $admin ) {
479480 if ( $row->log_strike ) {
480 - $strikeLink = $sk->makeKnownLinkObj( $thisTitle, wfMsg( "boardvote_unstrike" ),
 481+ $strikeLink = $sk->makeKnownLinkObj( $thisTitle, wfMsg( 'boardvote_unstrike' ),
481482 "action=unstrike&id={$row->log_id}" );
482483 } else {
483 - $strikeLink = $sk->makeKnownLinkObj( $thisTitle, wfMsg( "boardvote_strike" ),
 484+ $strikeLink = $sk->makeKnownLinkObj( $thisTitle, wfMsg( 'boardvote_strike' ),
484485 "action=strike&id={$row->log_id}" );
485486 }
486487
@@ -499,14 +500,12 @@
500501 }
501502
502503 function dump() {
503 - global $wgOut, $wgOutputEncoding, $wgLang;
 504+ global $wgOut, $wgLang;
504505 $dbr =& $this->getDB();
505 - $log = $dbr->tableName( "vote_log" );
506506
507 - $sql = "SELECT log_record FROM $log WHERE log_current=1 AND log_strike=0";
508 - $res = $dbr->query( $sql, DB_SLAVE, "BoardVotePage::list" );
 507+ $res = $dbr->select( 'vote_log', array( 'log_record' ), array( 'log_current' => 1, 'log_strike' => 0 ), __METHOD__ );
509508 if ( $dbr->numRows( $res ) == 0 ) {
510 - $wgOut->addWikiText( wfMsg( "boardvote_novotes" ) );
 509+ $wgOut->addWikiMsg( 'boardvote_novotes' );
511510 return;
512511 }
513512
@@ -518,10 +517,16 @@
519518 $wgOut->addHTML( $s );
520519 }
521520
 521+ /**
 522+ * Checks if the user is allowed to administrate board elections
 523+ * by checking for the 'boardvote' user right
 524+ *
 525+ * @return boolean: true if the user has 'boardvote' right, otherwise false
 526+ */
522527 function isAdmin() {
523528 global $wgUser;
524529 $userRights = $wgUser->getRights();
525 - if ( in_array( "boardvote", $userRights ) ) {
 530+ if ( in_array( 'boardvote', $userRights ) ) {
526531 return true;
527532 } else {
528533 return false;
@@ -532,17 +537,15 @@
533538 global $wgOut;
534539
535540 $dbw =& $this->getDB();
536 - $log = $dbw->tableName( "vote_log" );
537541
538542 if ( !$this->isAdmin() ) {
539 - $wgOut->addWikiText( wfMsg( "boardvote_needadmin" ) );
 543+ $wgOut->addWikiMsg( 'boardvote_needadmin' );
540544 return;
541545 }
542546 $value = $unstrike ? 0 : 1;
543 - $sql = "UPDATE $log SET log_strike=$value WHERE log_id=$id";
544 - $dbw->query( $sql, "BoardVotePage::strike" );
 547+ $dbw->update( 'vote_log', array( 'log_strike' => $value ), array( 'log_id' => $id ), __METHOD__ );
545548
546 - $title = Title::makeTitle( NS_SPECIAL, "Boardvote" );
 549+ $title = SpecialPage::getTitleFor( 'BoardVote' );
547550 $wgOut->redirect( $title->getFullURL( "action=list" ) );
548551 }
549552
@@ -557,4 +560,4 @@
558561
559562 return true;
560563 }
561 -}
 564+}
\ No newline at end of file
Index: trunk/extensions/BoardVote/BoardVote.i18n.php
@@ -2,18 +2,22 @@
33 /**
44 * Internationalisation file for BoardVote extension.
55 *
6 - * @addtogroup Extensions
 6+ * @file
 7+ * @ingroup Extensions
78 */
89
910 $messages = array();
10 -
 11+/** English
 12+ * @author Tim Starling
 13+ * @author Kwan Ting Chan
 14+*/
1115 $messages['en'] = array(
12 - 'boardvote' => "Wikimedia Board of Trustees election",
13 - 'boardvote-desc' => '[[meta:Board elections/2008|Wikimedia Board of Trustees election]]',
14 - 'boardvote_entry' => "* [[Special:Boardvote/vote|Vote]]
15 -* [[Special:Boardvote/list|List votes to date]]
16 -* [[Special:Boardvote/dump|Dump encrypted election record]]",
17 - 'boardvote_intro' => "<p>Welcome to the 2008 election for the Wikimedia Board of Trustees.
 16+ 'boardvote' => 'Wikimedia Board of Trustees election',
 17+ 'boardvote-desc' => '[[meta:Board elections/2008|Wikimedia Board of Trustees election]]',
 18+ 'boardvote_entry' => "* [[Special:BoardVote/vote|Vote]]
 19+* [[Special:BoardVote/list|List votes to date]]
 20+* [[Special:BoardVote/dump|Dump encrypted election record]]",
 21+ 'boardvote_intro' => "<p>Welcome to the 2008 election for the Wikimedia Board of Trustees.
1822 We are voting for one person to represent the community of users on the various Wikimedia projects.
1923 They will help to determine the future direction that the Wikimedia projects will take, individually and as a group, and represent <em>your</em> interests and concerns to the Board of Trustees.
2024 They will decide on ways to generate income and the allocation of moneys raised.</p>
@@ -31,12 +35,12 @@
3236 <ul><li><a href=\"http://meta.wikimedia.org/wiki/Board_elections/2008\" class=\"external\">Board elections 2008</a></li>
3337 <li><a href=\"http://meta.wikimedia.org/wiki/Board_elections/2008/Candidates\" class=\"external\">Candidates</a></li>
3438 <li><a href=\"http://en.wikipedia.org/wiki/Schulze_method\" class=\"external\">Schulze method</a></li></ul>",
35 - 'boardvote_intro_change' => "<p>You have voted before. However you may change
 39+ 'boardvote_intro_change' => "<p>You have voted before. However you may change
3640 your vote using the form below. Please rank the candidates in your order of preferences, whereby a smaller number
3741 indicate a higher preference for that particular candidate. You may give the same preference to more than one
3842 candidate and may keep candidates unranked.</p>",
39 - 'boardvote_footer' => "&nbsp;", # Do not translate this
40 - 'boardvote_entered' => "Thank you, your vote has been recorded.
 43+ 'boardvote_footer' => "&nbsp;", # Do not translate this
 44+ 'boardvote_entered' => "Thank you, your vote has been recorded.
4145
4246 If you wish, you may record the following details. Your voting record is:
4347
@@ -46,55 +50,54 @@
4751
4852 <pre>$2</pre>
4953
50 -The resulting encrypted version follows. It will be [[Special:Boardvote/dump|displayed publicly]].
 54+The resulting encrypted version follows. It will be [[Special:BoardVote/dump|displayed publicly]].
5155
5256 <pre>$3</pre>
5357
54 -[[Special:Boardvote/entry|Back]]",
55 - 'boardvote_invalidentered'=> "<p><strong>Error</strong>: candidate preference must be expressed in positive whole number only (1, 2, 3, ....), or
 58+[[Special:BoardVote/entry|Back]]",
 59+ 'boardvote_invalidentered' => "<p><strong>Error</strong>: candidate preference must be expressed in positive whole number only (1, 2, 3, ....), or
5660 left empty.</p>",
57 - 'boardvote_nosession' => "Your Wikimedia user ID could not be determined.
58 -Please log in to the wiki where you are qualified to vote, and go to <nowiki>[[Special:Boardvote]]</nowiki>.
 61+ 'boardvote_nosession' => "Your Wikimedia user ID could not be determined.
 62+Please log in to the wiki where you are qualified to vote, and go to <nowiki>[[Special:BoardVote]]</nowiki>.
5963 You must use an account with at least $1 {{PLURAL:$1|contribution|contributions}} before $2, and have made at least $3 {{PLURAL:$3|contribution|contributions}} between $4 and $5.",
60 - 'boardvote_notloggedin' => "You are not logged in.
 64+ 'boardvote_notloggedin' => "You are not logged in.
6165 To vote, you must use an account with at least $1 {{PLURAL:$1|contribution|contributions}} before $2, and have made at least $3 {{PLURAL:$3|contribution|contributions}} between $4 and $5.",
62 - 'boardvote_notqualified' => "You are not qualified to vote in this election.
 66+ 'boardvote_notqualified' => "You are not qualified to vote in this election.
6367 You need to have made at least $1 {{PLURAL:$1|contribution|contributions}} before $2, and have made at least $3 {{PLURAL:$3|contribution|contributions}} between $4 and $5.",
64 - 'boardvote_novotes' => "Nobody has voted yet.",
65 - 'boardvote_time' => "Time",
66 - 'boardvote_user' => "User",
67 - 'boardvote_edits' => "Edits",
68 - 'boardvote_days' => "Days",
69 - 'boardvote_ip' => "IP",
70 - 'boardvote_ua' => "User agent",
71 - 'boardvote_listintro' => "<p>This is a list of all votes which have been recorded to date.
 68+ 'boardvote_novotes' => 'Nobody has voted yet.',
 69+ 'boardvote_time' => 'Time',
 70+ 'boardvote_user' => 'User',
 71+ 'boardvote_edits' => 'Edits',
 72+ 'boardvote_days' => 'Days',
 73+ 'boardvote_ip' => 'IP',
 74+ 'boardvote_ua' => 'User agent',
 75+ 'boardvote_listintro' => "<p>This is a list of all votes which have been recorded to date.
7276 $1 for the encrypted data.</p>",
73 - 'boardvote_dumplink' => "Click here",
74 - 'boardvote_submit' => 'OK',
75 - 'boardvote_strike' => "Strike",
76 - 'boardvote_unstrike' => "Unstrike",
77 - 'boardvote_needadmin' => "Only election administrators can perform this operation.",
78 - 'boardvote_sitenotice' => "<a href=\"{{localurle:Special:Boardvote/vote}}\">Wikimedia Board Elections</a>:
79 -Vote open until June 22",
80 - 'boardvote_notstarted' => 'Voting has not yet started',
81 - 'boardvote_closed' => 'Voting is now closed, see [http://meta.wikimedia.org/wiki/Board_elections/2008/Results the elections page for results] soon.',
82 - 'boardvote_edits_many' => 'many',
83 - 'group-boardvote' => 'Board vote admins',
84 - 'group-boardvote-member' => 'board vote admin',
85 - 'grouppage-boardvote' => '{{ns:project}}:Board vote admin',
86 - 'boardvote_blocked' => 'You have been blocked on your registered wiki.
 77+ 'boardvote_dumplink' => 'Click here',
 78+ 'boardvote_submit' => 'OK',
 79+ 'boardvote_strike' => 'Strike',
 80+ 'boardvote_unstrike' => 'Unstrike',
 81+ 'boardvote_needadmin' => 'Only election administrators can perform this operation.',
 82+ 'boardvote_sitenotice' => '<a href="{{localurle:Special:BoardVote/vote}}">Wikimedia Board Elections</a>:
 83+Vote open until June 22',
 84+ 'boardvote_notstarted' => 'Voting has not yet started',
 85+ 'boardvote_closed' => 'Voting is now closed, see [http://meta.wikimedia.org/wiki/Board_elections/2008/Results the elections page for results] soon.',
 86+ 'boardvote_edits_many' => 'many',
 87+ 'group-boardvote' => 'Board vote admins',
 88+ 'group-boardvote-member' => 'board vote admin',
 89+ 'grouppage-boardvote' => '{{ns:project}}:Board vote admin',
 90+ 'boardvote_blocked' => 'You have been blocked on your registered wiki.
8791 Blocked users are not allowed to vote.',
88 - 'boardvote_bot' => 'You are flagged as a bot on your registered wiki.
 92+ 'boardvote_bot' => 'You are flagged as a bot on your registered wiki.
8993 Bot accounts are not allowed to vote.',
90 - 'boardvote_welcome' => "Welcome '''$1'''!",
91 - 'go_to_board_vote' => 'Wikimedia Board Elections 2008',
92 - 'boardvote_redirecting' => 'For improved security and transparency, we are running the vote on an external, independently controlled server.
 94+ 'boardvote_welcome' => "Welcome '''$1'''!",
 95+ 'go_to_board_vote' => 'Wikimedia Board Elections 2008',
 96+ 'boardvote_redirecting' => 'For improved security and transparency, we are running the vote on an external, independently controlled server.
9397
9498 You will be redirected to this external server in 20 seconds. [$1 Click here] to go there now.
9599
96100 A security warning about an unsigned certificate may be displayed.',
97 -
98 - 'right-boardvote' => 'Administer elections',
 101+ 'right-boardvote' => 'Administer elections',
99102 );
100103
101104 /** Message documentation (Message documentation)
Index: trunk/extensions/BoardVote/BoardVote.php
@@ -1,28 +1,36 @@
22 <?php
 3+/**
 4+ * Wikimedia Foundation Board of Trustees Election
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ * @author Tim Starling <tstarling@wikimedia.org>
 9+ * @author Kwan Ting Chan
 10+ * @link http://www.mediawiki.org/wiki/Extension:BoardVote Documentation
 11+ */
312
4 -# Wikimedia Foundation Board of Trustees Election
5 -
613 # Not a valid entry point, skip unless MEDIAWIKI is defined
7 -if (!defined('MEDIAWIKI')) {
 14+if( !defined('MEDIAWIKI') ) {
815 die( "Not a valid entry point\n" );
916 }
1017
1118 # Extension credits
1219 $wgExtensionCredits['other'][] = array(
13 - 'name' => 'BoardVote',
14 - 'url' => 'http://www.mediawiki.org/wiki/Extension:BoardVote',
15 - 'svn-date' => '$LastChangedDate$',
16 - 'svn-revision' => '$LastChangedRevision$',
17 - 'description' => '[[meta:Board elections|Wikimedia Board of Trustees election]]',
 20+ 'name' => 'BoardVote',
 21+ 'author' => array( 'Tim Starling', 'Kwan Ting Chan', 'others' )
 22+ 'url' => 'http://www.mediawiki.org/wiki/Extension:BoardVote',
 23+ 'svn-date' => '$LastChangedDate$',
 24+ 'svn-revision' => '$LastChangedRevision$',
 25+ 'description' => '[[meta:Board elections|Wikimedia Board of Trustees election]]',
1826 'descriptionmsg' => 'boardvote-desc',
1927 );
2028
2129 # Default settings
22 -$wgBoardVoteDB = "boardvote";
 30+$wgBoardVoteDB = 'boardvote';
2331 $wgBoardCandidates = array();
24 -/* $wgBoardCandidates = array( "John Doe", "Jane Doe", "Joe Bloggs", "John Smith", "A. N. Other" ); */
25 -$wgGPGCommand = "gpg";
26 -$wgGPGRecipient = "boardvote";
 32+/* $wgBoardCandidates = array( 'John Doe', 'Jane Doe', 'Joe Bloggs', 'John Smith', 'A. N. Other' ); */
 33+$wgGPGCommand = 'gpg';
 34+$wgGPGRecipient = 'boardvote';
2735 $wgGPGHomedir = false;
2836 $wgGPGPubKey = "C:\\Program Files\\GNU\\GnuPG\\pub.txt";
2937 $wgBoardVoteEditCount = 600;
@@ -31,24 +39,25 @@
3240 $wgBoardVoteRecentFirstCountDate = '20080101000000';
3341 $wgBoardVoteRecentCountDate = '20080529000000';
3442 $wgBoardVoteStartDate = '20080601000000';
35 -$wgBoardVoteEndDate = '20080622000000';
 43+$wgBoardVoteEndDate = '20080622000000';
3644 $wgBoardVoteDBServer = $wgDBserver;
3745
3846 # Vote admins
 47+$wgAvailableRights[] = 'boardvote';
3948 $wgGroupPermissions['boardvote']['boardvote'] = true;
40 -$wgAvailableRights[] = 'boardvote';
4149
 50+// Set up the new special page
4251 $dir = dirname(__FILE__) . '/';
4352 $wgExtensionMessagesFiles['BoardVote'] = $dir . 'BoardVote.i18n.php';
4453 $wgExtensionAliasesFiles['BoardVote'] = $dir . 'BoardVote.alias.php';
4554
4655 if ( !defined( 'BOARDVOTE_REDIRECT_ONLY' ) ) {
4756 $wgAutoloadClasses['BoardVotePage'] = $dir . 'BoardVote_body.php';
48 - $wgSpecialPages['Boardvote'] = 'BoardVotePage';
 57+ $wgSpecialPages['BoardVote'] = 'BoardVotePage';
4958 $wgExtensionFunctions[] = 'wfSetupBoardVote';
5059 } else {
5160 $wgAutoloadClasses['GoToBoardVotePage'] = $dir . 'GoToBoardVote_body.php';
52 - $wgSpecialPages['Boardvote'] = 'GoToBoardVotePage';
 61+ $wgSpecialPages['BoardVote'] = 'GoToBoardVotePage';
5362 }
5463
5564 function wfSetupBoardVote() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r45644Follow up r45639: change special page name to camelcase "BoardVote" from "Boa...raymond16:51, 10 January 2009

Status & tagging log