-
Notifications
You must be signed in to change notification settings - Fork 2
/
delete_jail.cgi
56 lines (46 loc) · 1.25 KB
/
delete_jail.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/perl
use strict;
use warnings;
our (%text, %in);
require './jailkit-lib.pl';
ReadParse();
my $jk_init_ini = get_jk_init_ini();
my @sections = $jk_init_ini->Sections();
my %jail_params;
my @d = split(/\0/, $in{'d'});
# If we've already confirmed go ahead an delete it
if (defined $in{'confirmed'}) {
foreach my $jail (@d) {
if ($jk_init_ini->SectionExists($jail)) {
$jk_init_ini->DeleteSection($jail);
}
else {
# Does this jail exist?
error(text('error_jail_not_found', "$jail", "<br>\n"));
}
}
write_jk_init_ini($jk_init_ini);
redirect('');
}
else {
ui_print_header(undef, $text{'index_delete_jail'}, "");
print "<center>\n";
# Check to be sure we really want these jails gone
print ui_form_start("delete_jail.cgi", "post");
foreach my $jail (@d) {
# Re-send all of the d_* items with a confirmed field
print ui_hidden("d", $jail);
}
print $text{'delete_are_you_sure'};
print "<p>\n";
foreach my $del_jail (@d) {
print "<i>$del_jail</i><br>\n";
}
print "</p>\n";
print ui_hidden("confirmed", "1");
#print ui_submit($text{delete_confirm}, "confirm");
print ui_form_end([["confirm", $text{'delete_confirm'}]]);
print "</center>\n";
ui_print_footer("");
}
ui_print_footer("");