| Index: trunk/extensions/SecurePoll/SecurePoll.i18n.php |
| — | — | @@ -74,6 +74,7 @@ |
| 75 | 75 | 'securepoll-api-token-mismatch' => 'Security token mismatch, cannot log in.', |
| 76 | 76 | 'securepoll-not-logged-in' => 'You must log in to vote in this election', |
| 77 | 77 | 'securepoll-too-few-edits' => 'Sorry, you cannot vote. You need to have made at least $1 {{PLURAL:$1|edit|edits}} to vote in this election, you have made $2.', |
| | 78 | + 'securepoll-too-new' => 'Sorry, you cannot vote. Your account needs to have been registered before $1 to vote in this election, you registered on $2.', |
| 78 | 79 | 'securepoll-blocked' => 'Sorry, you cannot vote in this election if you are currently blocked from editing.', |
| 79 | 80 | 'securepoll-bot' => 'Sorry, accounts with the bot flag are not allowed to vote in this election.', |
| 80 | 81 | 'securepoll-not-in-group' => 'Only members of the "$1" group can vote in this election.', |
| Index: trunk/extensions/SecurePoll/includes/user/Auth.php |
| — | — | @@ -213,7 +213,8 @@ |
| 214 | 214 | 'bot' => $user->isAllowed( 'bot' ), |
| 215 | 215 | 'language' => $user->getOption( 'language' ), |
| 216 | 216 | 'groups' => $user->getGroups(), |
| 217 | | - 'lists' => $this->getLists( $user ) |
| | 217 | + 'lists' => $this->getLists( $user ), |
| | 218 | + 'registration' => $user->getRegistration(), |
| 218 | 219 | ) |
| 219 | 220 | ); |
| 220 | 221 | wfRunHooks( 'SecurePoll_GetUserParams', array( $this, $user, &$params ) ); |
| Index: trunk/extensions/SecurePoll/includes/pages/ListPage.php |
| — | — | @@ -32,7 +32,8 @@ |
| 33 | 33 | |
| 34 | 34 | $pager = new SecurePoll_ListPager( $this ); |
| 35 | 35 | $wgOut->addHTML( |
| 36 | | - $pager->getLimitForm() . '<br />' . |
| | 36 | + $pager->getLimitForm() . |
| | 37 | + $pager->getNavigationBar() . |
| 37 | 38 | $pager->getBody() . |
| 38 | 39 | $pager->getNavigationBar() |
| 39 | 40 | ); |
| Index: trunk/extensions/SecurePoll/includes/ballots/RadioRangeBallot.php |
| — | — | @@ -67,7 +67,7 @@ |
| 68 | 68 | if ( $useMessageLabels ) { |
| 69 | 69 | foreach ( $scores as $score ) { |
| 70 | 70 | $signedScore = $this->addSign( $question, $score ); |
| 71 | | - $labels[$score] = $question->getMessage( "column$signedScore" ); |
| | 71 | + $labels[$score] = $question->parseMessage( "column$signedScore" ); |
| 72 | 72 | } |
| 73 | 73 | } else { |
| 74 | 74 | global $wgLang; |
| — | — | @@ -113,7 +113,7 @@ |
| 114 | 114 | "<tr>\n" . |
| 115 | 115 | "<th> </th>\n"; |
| 116 | 116 | foreach ( $labels as $label ) { |
| 117 | | - $s .= Xml::element( 'th', array(), $label ) . "\n"; |
| | 117 | + $s .= Html::rawElement( 'th', array(), $label ) . "\n"; |
| 118 | 118 | } |
| 119 | 119 | $s .= "</tr>\n"; |
| 120 | 120 | $defaultScore = $question->getProperty( 'default-score' ); |
| Index: trunk/extensions/SecurePoll/includes/entities/Election.php |
| — | — | @@ -17,6 +17,8 @@ |
| 18 | 18 | * Election |
| 19 | 19 | * min-edits |
| 20 | 20 | * Minimum number of edits needed to be qualified |
| | 21 | + * max-registration |
| | 22 | + * Latest acceptable registration date |
| 21 | 23 | * not-blocked |
| 22 | 24 | * True if voters need to not be blocked |
| 23 | 25 | * not-bot |
| — | — | @@ -163,6 +165,17 @@ |
| 164 | 166 | $status->fatal( 'securepoll-too-few-edits', $minEdits, $edits ); |
| 165 | 167 | } |
| 166 | 168 | |
| | 169 | + # Registration date |
| | 170 | + $maxDate = $this->getProperty( 'max-registration' ); |
| | 171 | + $date = isset( $props['registration'] ) ? $props['registration'] : 0; |
| | 172 | + if ( $maxDate && $date > $maxDate ) { |
| | 173 | + global $wgLang; |
| | 174 | + $status->fatal( |
| | 175 | + 'securepoll-too-new', |
| | 176 | + $wgLang->timeanddate( $maxDate ), |
| | 177 | + $wgLang->timeanddate( $date ) |
| | 178 | + ); |
| | 179 | + } |
| 167 | 180 | # Blocked |
| 168 | 181 | $notBlocked = $this->getProperty( 'not-blocked' ); |
| 169 | 182 | $isBlocked = !empty( $props['blocked'] ); |