?? conf_controls.cgi
字號(hào):
#! /usr/bin/perl## B9DDNS - BIND 9 dynamic DNS webmin module.# Copyright (C) 2003 John Horne. <john.horne@plymouth.ac.uk>## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.### Display control channel options.#use strict;no strict 'vars';require './b9ddns-lib.pl';my $ipv4 = my $ipv6 = my $i = 0;my $conf = my $controls = my $members = my $check = '';my $inet = my $key = my $ky = my $disabled = my $v = '';my @addrvals = my @keys = my @interface_keys = ();my %haskey = ();%access = &get_module_acl();unless ($access{'defaults'}) { &terror('controls_ecannot');}&ReadParse();$conf = &get_config();$controls = &find('controls', $conf);$members = (defined($controls)) ? $controls->{'members'} : [ ];@keys = &find('key', $conf);if (@keys) { @keys = map { $_->{'value'} } @keys;}else { $disabled = 'disabled';}&header($text{'controls_title'}, '');print '<hr>';print '<form action=save_controls.cgi>';print '<input type=hidden name=disabled value="', $disabled, '">';print '<table border width=100%>';print "<tr $tb><td width=100%><b>", $text{'controls_header'}, '</b></td></tr>';print "<tr $cb><td><table width=100% border>\n";print '<tr><td><b>', $text{'controls_inet'}, '</b> ';printf '<input type=radio name=inet_def value=1 %s> %s ', &checked(! defined($controls)), $text{'default'};printf '<input type=radio name=inet_def value=-1 %s> %s ', &checked(defined($controls) && ! @$members), $text{'Disable'};printf '<input type=radio %s name=inet_def value=0 %s> %s</td></tr>', $disabled, &checked(@$members), $text{'net_below'};print "<tr $tb><td colspan=2 height=4></td></tr>";push(@$members, { });for ($i = 0; $i < @$members; $i++) { @addrvals = @interface_keys = (); %haskey = (); $inet = $members->[$i]; next if ($inet->{'name'} eq 'keys'); $v = $inet->{'values'}; $ipv4 = ($v->[0] eq '*'); $ipv6 = ($v->[0] eq '::'); print '<tr $cb><td><table width=100%>'; print '<tr><td><b>', $text{'Interface'}, '</b></td>'; printf '<td><input type=radio name=addr_%d value=-1 %s> %s ', $i, &checked($ipv4), $text{'controls_addr4'}; printf '<input type=radio name=addr_%d value=-2 %s> %s ', $i, &checked($ipv6), $text{'controls_addr6'}; printf '<input type=radio name=addr_%d value=1 %s> ', $i, &checked(! $ipv4 && ! $ipv6 && $v->[0]); printf '<input name=address_%d size=40 value="%s"></td>', $i, ($ipv4 || $ipv6) ? '' : $v->[0]; print "<td><b>$text{'net_port'}</b></td>"; printf '<td><input type=radio name=pdef_%d value=1 %s> %s ', $i, &checked($v->[1] ne 'port'), $text{'default'}; printf '%s<input type=radio name=pdef_%d value=0 %s> ', ' ', $i, &checked($v->[1] eq 'port'); printf '<input name=port_%d size=6 value="%s"></td></tr>', $i, ($v->[1] eq 'port') ? $v->[2] : ''; if ((($i + 1) < @$members) && $members->[$i + 1]->{'name'} eq 'keys') { $ky = $members->[$i + 1]; foreach $key (@{ $ky->{'members'} }) { $haskey{$key->{'name'}}++; } } push(@interface_keys, @keys, keys(%haskey)); @interface_keys = sort(&unique(@interface_keys)); print '<tr><td><b>', $text{'Allowed_keys'}, '</b></td>'; print '<td>'; foreach $key (@interface_keys) { printf "<input type=checkbox %s name=keys_%d value='%s' %s> %s\n", $disabled, $i, $key, &checked($haskey{$key}), $key; } print '</td></tr>'; @addrvals = map { $_->{'name'} } @{ $inet->{'members'} }; print '<tr><td valign=top><b>', $text{'Allowed_addr'}, '</b></td>'; printf '<td valign=top><textarea name=allow_%d rows=4 cols=40 wrap=auto>', $i; print join("\n", @addrvals), '</textarea></td>'; print "</tr>\n"; print "</table></td></tr>\n";}print '</table></td></tr></table>';print '<input type=submit value="', $text{'save'}, "\"></form>\n";print '<hr>';&footer('', $text{'index_return'});exit;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -