Handle hostnames with upper-case letters
[webmin.git] / squid / edit_misc.cgi
1 #!/usr/local/bin/perl
2 # edit_misc.cgi
3 # A form for edit misc options
4
5 require './squid-lib.pl';
6 $access{'miscopt'} || &error($text{'emisc_ecannot'});
7 &ui_print_header(undef, $text{'emisc_header'}, "", "edit_misc", 0, 0, 0, &restart_button());
8 $conf = &get_config();
9
10 print "<form action=save_misc.cgi>\n";
11 print "<table border width=100%>\n";
12 print "<tr $tb> <td><b>$text{'emisc_mo'}</b></td> </tr>\n";
13 print "<tr $cb> <td><table width=100%>\n";
14
15 print "<tr>\n";
16 print &opt_input($text{'emisc_sdta'}, "dns_testnames", $conf,
17                  $text{'default'}, 40);
18 print "</tr>\n";
19
20 print "<tr>\n";
21 print &opt_input($text{'emisc_slr'}, "logfile_rotate", $conf,
22                  $text{'default'}, 6);
23 print &opt_input($text{'emisc_dd'}, "append_domain", $conf, $text{'none'}, 10);
24 print "</tr>\n";
25
26 if ($squid_version < 2) {
27         print "<tr>\n";
28         print &opt_input($text{'emisc_sp'}, "ssl_proxy", $conf, $text{'none'}, 15);
29         print &opt_input($text{'emisc_nghp'}, "passthrough_proxy",
30                          $conf, $text{'none'}, 15);
31         print "</tr>\n";
32         }
33
34 print "<tr>\n";
35 print &opt_input($text{'emisc_emt'}, "err_html_text", $conf, $text{'none'}, 40);
36 print "</tr>\n";
37
38 print "<tr>\n";
39 print &choice_input($text{'emisc_pcs'}, "client_db", $conf,
40                     "on", $text{'yes'}, "on", $text{'no'}, "off");
41 print &choice_input($text{'emisc_xffh'}, "forwarded_for", $conf,
42                     "on", $text{'yes'}, "on", $text{'no'}, "off");
43 print "</tr>\n";
44
45 print "<tr>\n";
46 print &choice_input($text{'emisc_liq'}, "log_icp_queries", $conf,
47                     "on", $text{'yes'}, "on", $text{'no'}, "off");
48 print &opt_input($text{'emisc_mdh'}, "minimum_direct_hops", $conf,
49                  $text{'default'}, 6);
50 print "</tr>\n";
51
52 print "<tr>\n";
53 print &choice_input($text{'emisc_kmffu'}, "memory_pools", $conf,
54                     "on", $text{'yes'}, "on", $text{'no'}, "off");
55 if ($squid_version >= 2) {
56         print &opt_bytes_input($text{'emisc_aomtk'}, "memory_pools_limit",
57                                $conf, $text{'emisc_u'}, 6);
58         }
59 print "</tr>\n";
60
61 print "<tr>\n";
62 if ($squid_version >= 2.2 && $squid_version < 2.5) {
63         foreach $a (&find_config("anonymize_headers", $conf)) {
64                 @ap = @{$a->{'values'}};
65                 $anon = shift(@ap);
66                 push(@anon, @ap);
67                 }
68         print "<td valign=top><b>$text{'emisc_htpt'}</b></td> ",
69               "<td colspan=3>\n";
70         printf "<input type=radio name=anon_mode value=0 %s> $text{'emisc_ah'}<br>\n",
71                 $anon ? "" : "checked";
72         printf "<input type=radio name=anon_mode value=1 %s> $text{'emisc_oh'}\n",
73                 $anon eq "allow" ? "checked" : "";
74         printf "<input name=anon_allow size=50 value='%s'><br>\n",
75                 $anon eq "allow" ? join(" ", @anon) : "";
76         printf "<input type=radio name=anon_mode value=2 %s> $text{'emisc_ae'}\n",
77                 $anon eq "deny" ? "checked" : "";
78         printf "<input name=anon_deny size=50 value='%s'>\n",
79                 $anon eq "deny" ? join(" ", @anon) : "";
80         print "</td> </tr> <tr>\n";
81         }
82 elsif ($squid_version < 2.2) {
83         print &choice_input($text{'emisc_a'}, "http_anonymizer", $conf,
84                             "off", $text{'emisc_off'}, "off", 
85                                 $text{'emisc_std'}, "standard",
86                             $text{'emisc_par'}, "paranoid");
87         }
88 print &opt_input($text{'emisc_fua'}, "fake_user_agent", $conf, $text{'none'}, 15);
89
90 print "</tr><tr>\n";
91 if ($squid_version < 2.6) {
92         $host = &find_value("httpd_accel_host", $conf);
93         print "<td><b>$text{'emisc_hah'}</b></td> <td colspan=3>\n";
94         printf "<input type=radio name=accel value=0 %s> %s\n",
95                 $host ? "" : "checked", $text{'emisc_none'};
96         printf "<input type=radio name=accel value=1 %s> %s\n",
97                 $host eq "virtual" ? "checked" : "", $text{'emisc_virtual'};
98         printf "<input type=radio name=accel value=2 %s>\n",
99                 $host eq "virtual" || !$host ? "" : "checked";
100         printf "<input name=httpd_accel_host size=50 value='%s'></td>\n",
101                 $host eq "virtual" ? "" : $host;
102         print "</tr><tr>\n";
103         print &opt_input($text{'emisc_hap'}, "httpd_accel_port", $conf,
104                          $text{'emisc_none'}, 10);
105         if ($squid_version >= 2.5) {
106                 print &choice_input($text{'emisc_hash'}, "httpd_accel_single_host", 
107                                   $conf, "off", $text{'yes'}, "on", $text{'no'}, "off");
108                 }
109         print "</tr><tr>\n";
110         print &choice_input($text{'emisc_hawp'}, "httpd_accel_with_proxy",
111                           $conf, "off", $text{'on'}, "on", $text{'off'}, "off");
112         print &choice_input($text{'emisc_hauhh'}, "httpd_accel_uses_host_header", 
113                           $conf, "off", $text{'yes'}, "on", $text{'no'}, "off");
114         print "</tr><tr>\n";
115         }
116
117 if ( $squid_version >= 2.3) {
118         print &opt_input($text{'emisc_wccprtr'}, "wccp_router", $conf,
119                          $text{'default'}, 35);
120         print "</tr><tr>\n";
121         print &opt_input($text{'emisc_wccpin'}, "wccp_incoming_address",
122                          $conf, $text{'default'}, 35);
123         print "</tr><tr>\n";
124         print &opt_input($text{'emisc_wccpout'}, "wccp_outgoing_address",
125                          $conf, $text{'default'}, 35);
126         print "</tr><tr>\n";
127         }
128
129 print "</table></td></tr></table>\n";
130 print "<input type=submit value='$text{'buttsave'}'></form>\n";
131
132 &ui_print_footer("", $text{'emisc_return'});
133