3 # Cancel one or more downloads
5 require './updown-lib.pl';
7 &error_setup($text{'cancel_err'});
9 @ids = split(/\0/, $in{'cancel'});
10 @ids || &error($text{'cancel_enone'});
12 # Delete each one, and its At jobs, and kill its PID
14 &foreign_require("at", "at-lib.pl");
15 @ats = &at::list_atjobs();
18 $down = &get_download($i);
19 &can_as_user($down->{'user'}) ||
20 &error(&text('cancel_ecannot', $down->{'user'}));
22 &delete_download($down);
25 if ($a->{'realcmd'} =~ /\Q$atjob_cmd\E\s+\Q$i\E/) {
26 # Found the job to cancel
27 &at::delete_atjob($a->{'id'});
32 &kill_logged('TERM', $down->{'pid'});
35 &webmin_log("cancel", undef, undef, { 'ids' => \@ids });
36 &redirect("index.cgi?mode=download");