Handle hostnames with upper-case letters
[webmin.git] / squid / edit_admin.cgi
1 #!/usr/local/bin/perl
2 # edit_admin.cgi
3 # A form for editing admin options
4
5 require './squid-lib.pl';
6 $access{'admopts'} || &error($text{'eadm_ecannot'});
7 &ui_print_header(undef, $text{'eadm_header'}, "", "edit_admin", 0, 0, 0, &restart_button());
8 $conf = &get_config();
9
10 print "<form action=save_admin.cgi>\n";
11 print "<table border width=100%>\n";
12 print "<tr $tb> <td><b>$text{'eadm_aao'}</b></td> </tr>\n";
13 print "<tr $cb> <td><table width=100%>\n";
14
15 if ($squid_version < 2) {
16         print "<tr>\n";
17         $v = &find_config("cache_effective_user", $conf);
18         print "<td><b>$text{'eadm_runasuu'}</b></td> <td colspan=3>\n";
19         printf "<input type=radio name=effective_def value=1 %s> $text{'eadm_nochange'}\n",
20                 $v ? "" : "checked";
21         printf "&nbsp;<input type=radio name=effective_def value=0 %s>\n",
22                 $v ? "checked" : "";
23         print $text{'eadm_user'} ,&unix_user_input("effective_u",
24                                        $v->{'values'}->[0]),"\n";
25         print $text{'eadm_group'} ,&unix_group_input("effective_g",
26                                          $v->{'values'}->[1]),"\n";
27         print "</td> </tr>\n";
28         }
29 else {
30         print "<tr>\n";
31         print &opt_input($text{'eadm_runasuu'}, "cache_effective_user", $conf,
32                          $text{'eadm_nochange'}, 8,
33                          &user_chooser_button("cache_effective_user", 0));
34         print &opt_input($text{'eadm_runasug'}, "cache_effective_group", $conf,
35                          $text{'eadm_nochange'}, 8,
36                          &group_chooser_button("cache_effective_group", 0));
37         print "</tr>\n";
38         }
39
40 print "<tr>\n";
41 print &opt_input($text{'eadm_cmemail'}, "cache_mgr",
42                  $conf, $text{'eadm_default'}, 35);
43 print "</tr>\n";
44
45 print "<tr>\n";
46 print &opt_input($text{'eadm_vhost'}, "visible_hostname",
47                  $conf, $text{'eadm_auto'}, 35);
48 print "</tr>\n";
49
50 if ($squid_version < 2) {
51         print "<tr>\n";
52         print &opt_input($text{'eadm_annto'}, "announce_to",
53                          $conf, $text{'eadm_default'}, 40);
54         print "</tr>\n";
55
56         print "<tr>\n";
57         print &opt_input($text{'eadm_every'}, "cache_announce", $conf,
58                          $text{'eadm_never'}, 6, "hours");
59         print "</tr>\n";
60         }
61 else {
62         print "<tr>\n";
63         print &opt_input($text{'eadm_uniq'}, "unique_hostname",
64                          $conf, $text{'eadm_auto'}, 35);
65         print "</tr>\n";
66
67         if ($squid_version >= 2.4) {
68                 print "<tr>\n";
69                 print &opt_input($text{'eadm_haliases'}, "hostname_aliases",
70                                  $conf, $text{'eadm_none'}, 35);
71                 print "</tr>\n";
72                 }
73
74         print "<tr>\n";
75         print &opt_input($text{'eadm_cah'}, "announce_host", $conf,
76                          $text{'eadm_default'}, 20);
77         print &opt_input($text{'eadm_cap'}, "announce_port", $conf,
78                          $text{'eadm_default'}, 6);
79         print "</tr>\n";
80
81         print "<tr>\n";
82         print &opt_input($text{'eadm_caf'}, "announce_file", $conf,
83                          $text{'eadm_none'}, 35, &file_chooser_button("announce_file"));
84         print "</tr>\n";
85
86         print "<tr>\n";
87         print &opt_time_input($text{'eadm_annp'}, "announce_period", $conf,
88                               $text{'eadm_default'}, 4);
89         print "</tr>\n";
90         }
91
92 print "</table></td></tr></table>\n";
93 print "<input type=submit value=$text{'eadm_buttsave'}></form>\n";
94
95 &ui_print_footer("", $text{'eadm_return'});
96