hook(type => "getsetup", id => "poll", call => \&getsetup);
hook(type => "preprocess", id => "poll", call => \&preprocess);
hook(type => "sessioncgi", id => "poll", call => \&sessioncgi);
hook(type => "getsetup", id => "poll", call => \&getsetup);
hook(type => "preprocess", id => "poll", call => \&preprocess);
hook(type => "sessioncgi", id => "poll", call => \&sessioncgi);
my %params=(open => "yes", total => "yes", percent => "yes", @_);
my $open=IkiWiki::yesno($params{open});
my %params=(open => "yes", total => "yes", percent => "yes", @_);
my $open=IkiWiki::yesno($params{open});
foreach my $choice (@choices) {
if ($open && exists $config{cgiurl}) {
# use POST to avoid robots
foreach my $choice (@choices) {
if ($open && exists $config{cgiurl}) {
# use POST to avoid robots
- IkiWiki::rcs_commit($pagesources{$page}, "poll vote ($choice)",
- IkiWiki::rcs_prepedit($pagesources{$page}),
- $session->param("name"), $ENV{REMOTE_ADDR});
+ IkiWiki::rcs_commit(
+ file => $pagesources{$page},
+ message => "poll vote ($choice)",
+ token => IkiWiki::rcs_prepedit($pagesources{$page}),
+ session => $session,
+ );
error($@) if $@;
my $cookie = CGI::Cookie->new(-name=> $session->name, -value=> $session->id);
print $cgi->redirect(-cookie => $cookie,
error($@) if $@;
my $cookie = CGI::Cookie->new(-name=> $session->name, -value=> $session->id);
print $cgi->redirect(-cookie => $cookie,