⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 conf_net.cgi

📁 BIND 9 dynamic DNS webmin module. This module supports both static and dynamic zones, and IPv4 and I
💻 CGI
字号:
#! /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 name server address options.#use strict;no strict 'vars';require './b9ddns-lib.pl';my $i = 0;my $conf = my $options = my $members = '';my $src = my $srcstr = my $saddr = my $sport = '';my $ip6_addr = '';my @listen = my @values = ();%access = &get_module_acl();unless ($access{'defaults'}) {	&terror('net_ecannot');}&ReadParse();$conf = &get_config();$options = &find('options', $conf);$members = (defined($options)) ? $options->{'members'} : [ ];&header($text{'net_title'}, '');print '<hr>';print '<form action=save_net.cgi>';print '<table border width=100%>';print "<tr $tb><td><b>", $text{'net_header'}, '</b></td></tr>';print "<tr $cb><td><table width=100%>\n";@listen = &find('listen-on', $members);print '<tr><td valign=top><b>', $text{'net_listen4'}, '</b></td><td>';printf '&nbsp;<input type=radio name=listen4_def value=1 %s> %s ',	&checked(! scalar(@listen)), $text{'default'};printf '<input type=radio name=listen4_def value=0 %s> %s<br>',	&checked(scalar(@listen)), $text{'net_below'};print '<table width=100% border>';print "<tr $tb><td width=30%><b>$text{'net_port'}</b></td>",      "<td><b>$text{'net_addrs'}</b></td></tr>\n";push(@listen, { });for ($i = 0; $i < @listen; $i++) {	print "<tr $cb><td>";	printf '<input type=radio name=pdef4_%d value=1 %s> %s ',		$i, &checked($listen[$i]->{'value'} ne 'port'),		$text{'default'};	printf '<input type=radio name=pdef4_%d value=0 %s> ',		$i, &checked($listen[$i]->{'value'} eq 'port');	printf '<input name=port4_%d size=6 value="%s"></td>',		$i, ($listen[$i]->{'value'} eq 'port') ?					$listen[$i]->{'values'}->[1] : '';	@values = map { $_->{'name'} } @{ $listen[$i]->{'members'} };	printf '<td><input name=addrs4_%d size=30 value="%s"></td>',		$i, join(' ', @values);	print "</tr>\n";}print "</table></td></tr><tr><td><br></td></tr>\n";$src = &find('listen-on-v6', $members);$ip6_addr = $src->{'members'}->[0]->{'name'} if (defined($src));print "<tr><td valign=top><b>$text{'net_listen6'}</b></td><td colspan=3>\n";printf '&nbsp;<input type=radio name=listen6_def value=1 %s> %s ',	&checked(! $src), $text{'default'};printf '<input type=radio name=listen6_def value=0 %s> %s<br>',	&checked($src), $text{'net_below'};print '<table width=100% border>';print "<tr $tb><td width=30%><b>$text{'net_port'}</b></td>",      "<td><b>$text{'net_addrs'}</b></td></tr>\n";print "<tr $cb><td>";printf '<input type=radio name=pdef6 value=1 %s> %s ',	&checked($src->{'value'} ne 'port'), $text{'default'};printf '<input type=radio name=pdef6 value=0 %s> ',	&checked($src->{'value'} eq 'port');printf '<input name=port6 size=6 value="%s"></td>',	($src->{'value'} eq 'port') ? $src->{'values'}->[1] : '';printf '<td><input type=radio name=addrs6 value=-1 %s> %s ',	&checked(! $ip6_addr), $text{'default'};printf '<input type=radio name=addrs6 value=1 %s> %s ',	&checked($ip6_addr eq 'any'), $text{'logging_any'};printf '<input type=radio name=addrs6 value=0 %s> %s</td>',	&checked($ip6_addr eq 'none'), $text{'slave_none'};print "</tr></table></td></tr>\n";print '<tr><td colspan=2><hr></td></tr>';$src = &find('query-source', $members);$srcstr = join(' ', @{ $src->{'values'} }) if (defined($src));$sport = $1 if ($srcstr =~ /port\s+((\d+|\*))/io);$saddr = $1 if ($srcstr =~ /address\s+(([\d.]+|\*))/io);print "<tr><td><b>$text{'net_saddr4'}</b></td><td>\n";printf '&nbsp;<input type=radio name=saddr4_def value=1 %s> %s ',	&checked(! $saddr), $text{'default'};printf '<input type=radio name=saddr4_def value=-1 %s> %s ',	&checked($saddr eq '*'), $text{'logging_any'};printf '<input type=radio name=saddr4_def value=0 %s> ',	&checked($saddr && $saddr ne '*');printf '<input name=saddr4 size=35 value="%s"></td></tr>',	($saddr eq '*') ? '' : $saddr;print "<tr><td><b>$text{'net_sport'}</b></td><td>\n";printf '&nbsp;<input type=radio name=sport4_def value=1 %s> %s ',	&checked(! $sport), $text{'default'};printf '<input type=radio name=sport4_def value=-1 %s> %s ',	&checked($sport eq '*'), $text{'logging_any'};printf '<input type=radio name=sport4_def value=0 %s> ',	&checked($sport && $sport ne '*');printf '<input name=sport4 size=6 value="%s"></td></tr>',	($sport eq '*') ? '' : $sport;$src = &find('query-source-v6', $members);$srcstr = $saddr = $sport = '';$srcstr = join(' ', @{ $src->{'values'} }) if (defined($src));$sport = $1 if ($srcstr =~ /port\s+((\d+|\*))/io);$saddr = $1 if ($srcstr =~ /address\s+(([\da-f:]+|\*))/io);print "<tr><td><b>$text{'net_saddr6'}</b></td><td>\n";printf '&nbsp;<input type=radio name=saddr6_def value=1 %s> %s ',	&checked(! $saddr), $text{'default'};printf '<input type=radio name=saddr6_def value=-1 %s> %s ',	&checked($saddr eq '*'), $text{'logging_any'};printf '<input type=radio name=saddr6_def value=0 %s> ',	&checked($saddr && $saddr ne '*');printf '<input name=saddr6 size=35 value="%s"></td></tr>',	($saddr eq '*') ? '' : $saddr;print "<tr><td><b>$text{'net_sport'}</b></td><td>\n";printf '&nbsp;<input type=radio name=sport6_def value=1 %s> %s ',	&checked(! $sport), $text{'default'};printf '<input type=radio name=sport6_def value=-1 %s> %s ',	&checked($sport eq '*'), $text{'logging_any'};printf '<input type=radio name=sport6_def value=0 %s> ',	&checked($sport && $sport ne '*');printf '<input name=sport6 size=6 value="%s"></td></tr>',	($sport eq '*') ? '' : $sport;print '</table></td></tr></table>';print '<input type=submit value="', $text{'save'}, '"></form>';print '<hr>';&footer('', $text{'index_return'});exit;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -