mirror of
https://github.com/webmin/webmin.git
synced 2026-02-12 10:02:06 +00:00
59 lines
1.7 KiB
Perl
Executable File
59 lines
1.7 KiB
Perl
Executable File
#!/usr/local/bin/perl
|
|
# edit_sports.cgi
|
|
# A form for editing simple networking options
|
|
|
|
require './squid-lib.pl';
|
|
$access{'portsnets'} || &error($text{'eports_ecannot'});
|
|
&ui_print_header(undef, $text{'eports_header'}, "", "", 0, 0, 0, &restart_button());
|
|
$conf = &get_config();
|
|
|
|
print "<form action=save_sports.cgi>\n";
|
|
print "<table border width=100%>\n";
|
|
print "<tr $tb> <td><b>$text{'eports_pano'}</b></td> </tr>\n";
|
|
print "<tr $cb> <td><table width=100%>\n";
|
|
|
|
print "<tr>\n";
|
|
if ($squid_version >= 2.3) {
|
|
print "<td valign=top><b>$text{'eports_paap'}</b></td>\n";
|
|
print "<td colspan=3><table border>\n";
|
|
print "<tr $tb> <td><b>$text{'eports_p'}</b></td>\n",
|
|
"<td><b>$text{'eports_hia'}</b></td> </tr>\n";
|
|
foreach $p (&find_config('http_port', $conf)) {
|
|
push(@ports, @{$p->{'values'}});
|
|
}
|
|
$i = 0;
|
|
foreach $p (@ports, '') {
|
|
print "<tr $cb>\n";
|
|
printf "<td><input name=port_$i size=6 value='%s'></td> <td>\n",
|
|
$p =~ /(\d+)$/ ? $1 : '';
|
|
printf "<input type=radio name=addr_def_$i value=1 %s> All\n",
|
|
$p =~ /:/ ? '' : 'checked';
|
|
printf "<input type=radio name=addr_def_$i value=0 %s>\n",
|
|
$p =~ /:/ ? 'checked' : '';
|
|
printf "<input name=addr_$i size=20 value='%s'></td>\n",
|
|
$p =~ /^(\S+):/ ? $1 : '';
|
|
print "</tr>\n";
|
|
$i++;
|
|
}
|
|
|
|
print "</table></td></tr>\n";
|
|
}
|
|
else {
|
|
print &opt_input($text{'eports_pp'}, "http_port",
|
|
$conf, $text{'default'}, 6);
|
|
print &opt_input($text{'eports_ita'}, "tcp_incoming_address",
|
|
$conf, $text{'eports_a'}, 15);
|
|
print "</tr>\n";
|
|
}
|
|
|
|
print "<tr>\n";
|
|
print &opt_input($text{'emisc_sdta'}, "dns_testnames", $conf,
|
|
$text{'default'}, 40);
|
|
print "</tr>\n";
|
|
|
|
print "</table></td></tr></table>\n";
|
|
print "<input type=submit value='$text{'buttsave'}'></form>\n";
|
|
|
|
&ui_print_footer("", $text{'eports_return'});
|
|
|