summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-02-03 00:26:00 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-02-03 00:26:00 -0500
commit9f602728316096f235b3b28e7daacc7ece69bbd4 (patch)
treef6b648267f236b2a4ef42e68c4740297d8402faa /IkiWiki/Plugin
parent80915c830a03cf67c6770ef5e62d5178824b101e (diff)
* poll: This plugin turns out to have edited pages w/o doing any locking.
Oops. Convert it from a cgi to a sessioncgi hook, which will work much better.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/poll.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm
index 63c93c62d..a5727fc8e 100644
--- a/IkiWiki/Plugin/poll.pm
+++ b/IkiWiki/Plugin/poll.pm
@@ -7,7 +7,7 @@ use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "poll", call => \&preprocess);
- hook(type => "cgi", id => "poll", call => \&cgi);
+ hook(type => "sessioncgi", id => "poll", call => \&sessioncgi);
} # }}}
sub yesno ($) { #{{{
@@ -74,8 +74,9 @@ sub preprocess (@) { #{{{
return "<div class=poll>$ret</div>";
} # }}}
-sub cgi ($) { #{{{
+sub sessioncgi ($) { #{{{
my $cgi=shift;
+ my $session=shift;
if (defined $cgi->param('do') && $cgi->param('do') eq "poll") {
my $choice=$cgi->param('choice');
if (! defined $choice) {
@@ -92,7 +93,6 @@ sub cgi ($) { #{{{
# Did they vote before? If so, let them change their vote,
# and check for dups.
- my $session=IkiWiki::cgi_getsession();
my $choice_param="poll_choice_${page}_$num";
my $oldchoice=$session->param($choice_param);
if (defined $oldchoice && $oldchoice eq $choice) {