error(sprintf(gettext("%s is not a file"), $file));
}
- # Must be editable.
- IkiWiki::check_canedit($page, $q, $session);
-
# If a user can't upload an attachment, don't let them delete it.
# This is sorta overkill, but better safe than sorry.
if (! defined pagetype($pagesources{$page})) {
}
}
});
+ return defined $canremove ? $canremove : 1;
}
sub formbuilder_setup (@) {
my @pages=@_;
foreach my $page (@pages) {
+ IkiWiki::check_canedit($page, $q, $session);
check_canremove($page, $q, $session);
}
# and that the user is allowed to edit(/remove) it.
my @files;
foreach my $page (@pages) {
+ IkiWiki::check_canedit($page, $q, $session);
check_canremove($page, $q, $session);
# This untaint is safe because of the
foreach my $file (@files) {
IkiWiki::rcs_remove($file);
}
- IkiWiki::rcs_commit_staged(gettext("removed"),
- $session->param("name"),
- $session->remote_addr());
+ IkiWiki::rcs_commit_staged(
+ message => gettext("removed"),
+ session => $session,
+ );
IkiWiki::enable_commit_hook();
IkiWiki::rcs_update();
}