Handle hostnames with upper-case letters
[webmin.git] / frox / index.cgi
1 #!/usr/local/bin/perl
2 # Display icons for the various Frox config sections
3
4 require './frox-lib.pl';
5
6 # Make sure frox is installed
7 if (!-r $config{'frox_conf'} && -r $config{'alt_frox_conf'}) {
8         system("cp ".quotemeta($config{'alt_frox_conf'})." ".
9                      quotemeta($config{'frox_conf'}));
10         }
11 if (!-r $config{'frox_conf'}) {
12         &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
13         &ui_print_endpage(
14                 &ui_config_link('index_econf',
15                         [ "<tt>$config{'frox_conf'}</tt>", undef ]));
16         }
17 if (!&has_command($config{'frox'})) {
18         &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
19         &ui_print_endpage(
20                 &ui_config_link('index_ecmd',
21                         [ "<tt>$config{'frox'}</tt>", undef ]));
22         }
23
24 # Get the version
25 # XXX
26
27 # Show icons
28 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, 0,
29                  &help_search_link("frox", "man", "doc", "google"),
30                  undef, undef,
31                  &text('index_version', $frox_version));
32
33 @names = ( "net", "general", "ftp", "cache", "acl" );
34 push(@names, "iptables") if (&foreign_check("firewall"));
35 @titles = map { $text{$_."_title"} } @names;
36 @icons = map { "images/$_.gif" } @names;
37 @links = map { "edit_${_}.cgi" } @names;
38 &icons_table(\@links, \@titles, \@icons);
39
40 # Show start/stop/apply buttons
41 $conf = &get_config();
42 if (&find_value("FromInetd", $conf) ne "yes") {
43         print &ui_hr();
44         print &ui_buttons_start();
45         if (&is_frox_running()) {
46                 print &ui_buttons_row("apply.cgi", $text{'index_apply'},
47                                       $text{'index_applydesc'});
48                 print &ui_buttons_row("stop.cgi", $text{'index_stop'},
49                                       $text{'index_stopdesc'});
50                 }
51         else {
52                 print &ui_buttons_row("start.cgi", $text{'index_start'},
53                                       $text{'index_startdesc'});
54                 }
55         print &ui_buttons_end();
56         }
57 else {
58         print "<b>$text{'index_inetd'}</b><p>\n";
59         }
60
61 &ui_print_footer("/", $text{'index'});
62