-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.cgi
executable file
·64 lines (55 loc) · 1.88 KB
/
index.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
57
58
59
60
61
62
63
64
#!/usr/local/bin/perl
# index.cgi
require './bastille-manager-lib.pl';
# Check if bastille exists.
if (!&has_command($config{'bastille_path'})) {
&ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
print &text('index_errbastille', "<tt>$config{'bastille_path'}</tt>",
"$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
&ui_print_footer("/", $text{"index"});
exit;
}
# Get bastille version.
my $version = &get_bastille_version();
if (!$version == "blank") {
# Display version.
&write_file("$module_config_directory/version", {""},$version);
&ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, 0,
&help_search_link("BastilleBSD", "man", "doc", "google"), undef, undef,
&text('index_version', "$text{'index_modver'} $version"));
}
else {
# Don't display version.
&ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, 0,
&help_search_link("BastilleBSD", "man", "doc", "google"), undef, undef,
&text('index_version', ""));
}
# Start tabs.
@tabs = ();
push(@tabs, [ "res", $text{'index_jailres'}, "index.cgi?mode=res" ]);
if ($config{'show_conf'}) {
push(@tabs, [ "conf", $text{'index_edit'}, "index.cgi?mode=conf" ]);
}
if ($config{'show_advanced'}) {
push(@tabs, [ "advanced", $text{'index_advanced'}, "index.cgi?mode=advanced" ]);
}
print &ui_tabs_start(\@tabs, "mode", $in{'mode'} || $tabs[0]->[0], 1);
# Start jail resource tab.
print &ui_tabs_start_tab("mode", "res");
&ui_jail_res();
print &ui_tabs_end_tab("mode", "res");
# Start bastille config tab.
if ($config{'show_conf'}) {
print &ui_tabs_start_tab("mode", "conf");
&ui_bastille_conf();
print &ui_tabs_end_tab("mode", "conf");
}
# Start bastille advanced tab.
if ($config{'show_advanced'}) {
print &ui_tabs_start_tab("mode", "advanced");
&ui_bastille_advanced();
print &ui_tabs_end_tab("mode", "advanced");
}
# End tabs.
print &ui_tabs_end(1);
&ui_print_footer("/", $text{'index'});