]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/remove.pm
Use Digest::SHA built into perl rather than external Digest::SHA1 to simplify depende...
[git.ikiwiki.info.git] / IkiWiki / Plugin / remove.pm
index a46294e788815f30358bdba535b107bd78c24ba4..95f148183cba558be65a95a9687992293d122839 100644 (file)
@@ -107,6 +107,8 @@ sub confirmation_form ($$) {
                fields => [qw{do page}],
        );
        
+       $f->field(name => "sid", type => "hidden", value => $session->id,
+               force => 1);
        $f->field(name => "do", type => "hidden", value => "remove", force => 1);
 
        return $f, ["Remove", "Cancel"];
@@ -188,6 +190,8 @@ sub sessioncgi ($$) {
                        postremove($session);
                }
                elsif ($form->submitted eq 'Remove' && $form->validate) {
+                       IkiWiki::checksessionexpiry($q, $session, $q->param('sid'));
+
                        my @pages=$form->field("page");
        
                        # Validate removal by checking that the page exists,
@@ -209,8 +213,10 @@ sub sessioncgi ($$) {
                                foreach my $file (@files) {
                                        IkiWiki::rcs_remove($file);
                                }
-                               IkiWiki::rcs_commit_staged(gettext("removed"),
-                                       $session->param("name"), $ENV{REMOTE_ADDR});
+                               IkiWiki::rcs_commit_staged(
+                                       message => gettext("removed"),
+                                       session => $session,
+                               );
                                IkiWiki::enable_commit_hook();
                                IkiWiki::rcs_update();
                        }