X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ecdfd1b8644bc926db008054ab6192e18351afed..0ae1e4cc0e598eacfeb508d11db81c33169631fd:/IkiWiki/Plugin/remove.pm diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index 95f148183..336a781ed 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -42,9 +42,6 @@ sub check_canremove ($$$) { 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})) { @@ -74,6 +71,7 @@ sub check_canremove ($$$) { } } }); + return defined $canremove ? $canremove : 1; } sub formbuilder_setup (@) { @@ -102,7 +100,7 @@ sub confirmation_form ($$) { method => 'POST', javascript => 0, params => $q, - action => $config{cgiurl}, + action => IkiWiki::cgiurl(), stylesheet => 1, fields => [qw{do page}], ); @@ -121,6 +119,7 @@ sub removal_confirm ($$@) { my @pages=@_; foreach my $page (@pages) { + IkiWiki::check_canedit($page, $q, $session); check_canremove($page, $q, $session); } @@ -198,6 +197,7 @@ sub sessioncgi ($$) { # 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 @@ -240,7 +240,7 @@ sub sessioncgi ($$) { if (! exists $pagesources{$parent}) { $parent="index"; } - IkiWiki::redirect($q, urlto($parent, '/', 1)); + IkiWiki::redirect($q, urlto($parent, undef)); } } else {