Index: trunk/extensions/AJAXPoll/AJAXPoll.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * @author Jack Phoenix <jack@countervandalism.net> |
21 | 21 | * @author Thomas Gries |
22 | 22 | * @maintainer Thomas Gries |
23 | | - * @version 1.62 |
| 23 | + * @version 1.63 |
24 | 24 | * @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation |
25 | 25 | */ |
26 | 26 | |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | $wgExtensionCredits['parserhook'][] = array( |
33 | 33 | 'path' => __FILE__, |
34 | 34 | 'name' => 'AJAX Poll', |
35 | | - 'version' => '1.62 20120310', |
| 35 | + 'version' => '1.63 20120310', |
36 | 36 | 'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ), |
37 | 37 | 'descriptionmsg' => 'ajaxpoll-desc', |
38 | 38 | 'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll', |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | $wgAvailableRights[] = 'ajaxpoll-vote'; |
50 | 50 | |
51 | 51 | # default: everyone can vote |
52 | | -$wgGroupPermissions['*']['ajaxpoll-vote'] = true; |
| 52 | +$wgGroupPermissions['*']['ajaxpoll-vote'] = false; |
53 | 53 | # if you want only users to vote use |
54 | 54 | # $wgGroupPermissions['user']['ajaxpoll-vote'] = true; |
55 | 55 | |
Index: trunk/extensions/AJAXPoll/AJAXPoll_body.php |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | $user = $wgUser->getName(); |
162 | 162 | } |
163 | 163 | |
164 | | - if ( $wgUser->isAllowed( 'bot' ) ) { |
| 164 | + if ( !$wgUser->isAllowed( 'ajaxpoll-vote' ) || $wgUser->isAllowed( 'bot' ) ) { |
165 | 165 | return AJAXPoll::buildHTML( $ID, $user ); |
166 | 166 | } |
167 | 167 | |
— | — | @@ -348,7 +348,7 @@ |
349 | 349 | } else { |
350 | 350 | |
351 | 351 | $ret .= " |
352 | | -<div id='ajaxpoll-answer-" . $ans_no . "' class='ajaxpoll-answer'><div class='ajaxpoll-answer-name'><label for='ajaxpoll-post-answer-" . $ans_no . "' onclick='$(\"#ajaxpoll-ajax-" . $ID . "\").html(\"" . wfMsg( 'ajaxpoll-vote-permission' ) . "\");$(\"#ajaxpoll-ajax-" . $ID . "\").css(\"display\",\"block\");'><input disabled='disabled' type='radio' id='ajaxpoll-post-answer-" . $ans_no . "' name='ajaxpoll-post-answer-" . $ans_no . "' value='" . $i . "'" . ( $our ? 'checked=true ' : '' ) . "/>" . strip_tags( $lines[$i] ) . |
| 352 | +<div id='ajaxpoll-answer-" . $ans_no . "' class='ajaxpoll-answer'><div class='ajaxpoll-answer-name'><label for='ajaxpoll-post-answer-" . $ans_no . "' onclick='$(\"#ajaxpoll-ajax-" . $ID . "\").html(\"" . wfMsg( 'ajaxpoll-vote-permission' ) . "\");$(\"#ajaxpoll-ajax-" . $ID . "\").css(\"display\",\"block\");'><input disabled='disabled' type='radio' id='ajaxpoll-post-answer-" . $ans_no . "' name='ajaxpoll-post-answer-" . $ans_no . "' value='" . $i . "'/>" . strip_tags( $lines[$i] ) . |
353 | 353 | "</label></div><div class='ajaxpoll-answer-vote" . ( $our ? ' ajaxpoll-our-vote' : '' ) ."' onmouseover='mover(this)' onmouseout='mout(this);'><span title='" . wfMsg( 'ajaxpoll-percent-votes', sprintf( $percent ) ) . "'>" . ( ( isset( $poll_result ) && !empty( $poll_result[$i + 1] ) ) ? $poll_result[$i + 1] : 0 ) . "</span><div style='width: " . $percent . "%;" . ( $percent == 0 ? ' border:0;' : '' ) . "'></div></div> |
354 | 354 | </div> |
355 | 355 | "; |