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

📄 list_gen.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 $GENERATE entries.#use strict;no strict 'vars';require './b9ddns-lib.pl';my $dynamic = my $i = 0;my $conf = my $zone_conf = my $origin = my $view = '';my $gen = my $type = my $comment = '';my $zone = my $zone_hdr = my $disabled = '';my $lcgv2 = '';my @gens = my @range = my @gv = my @types = ();&ReadParse();%access = &get_module_acl();unless ($access{'gen'}) {	&terror('gen_ecannot');}$conf = &get_config();if ($in{'view'}) {	$view = $conf->[$in{'view'}];	$conf = $view->{'members'};}$zone = $conf->[$in{'index'}];$zone_conf = $zone->{'members'};$origin = lc($zone->{'value'});$origin .= '.' unless ($origin =~ /\.$/o);unless (&can_edit_zone(\%access, $zone, $view)) {	&terror('recs_ecannot');}$dynamic = $in{'dynamic'};if ($dynamic == 2) {	&terror('recs_eupdate');}if ($dynamic) {		# Dynamic zones won't have $GENERATE.}else {	@gens = grep { $_->{'generate'} } &get_zone($zone, $in{'file'}, $origin);}$zone_hdr = &zone_header($dynamic, $origin, $text{ucfirst($in{'type'})});&header($text{'gen_title'}, '', undef, 0, 0, 0, undef, undef, undef, $zone_hdr);unless ($config{'display_fqdn'}) {	$origin = &convert_fqdn(-1, $origin, '.', 1);}print '<center><font size=+2>', $origin, '</font></center><hr>';print '<form action=save_gen.cgi method=post>';print '<input type=hidden name=index value="', $in{'index'}, '">';print '<input type=hidden name=view value="', $in{'view'}, '">';print '<input type=hidden name=type value="', $in{'type'}, '">';print '<input type=hidden name=file value="', $in{'file'}, '">';print '<input type=hidden name=dynamic value="', $dynamic, '">';print '<table border width=100%>';print "<tr $tb><td><b>$text{'gen_type'}</b></td>",      '<td><b>', $text{'gen_range'}, '</b></td>',      '<td><b>', $text{'gen_name'}, '</b></td>',      '<td><b>', $text{'gen_value'}, '</b></td>';if (! $dynamic && $config{'allow_comments'}) {	print '<td><b>', $text{'gen_cmt'}, '</b></td>';}print "</tr>\n";$i = 0;@types = ('', 'A', 'PTR', 'CNAME', 'NS');foreach $gen (@gens, { }) {	if (defined($gen->{'generate'})) {		@gv = @{ $gen->{'generate'} };		$lcgv2 = lc($gv[2]);	}	else {		$lcgv2 = '';		@gv = ();	}	@range = ($gv[0] =~ /^(\d+)-(\d+)(\/(\d+))?$/o) ? ( $1, $2, $4 ) : ();	print "<tr $cb>\n";	print "<td><select name=type_$i>\n";	foreach $type (@types) {		if ($type) {			printf "<option value='%s' %s>%s\n",				$type, ($lcgv2 eq lc($type)) ? 'selected' : '',				$type ? $type : '&nbsp;';		}		else {			print '<option value="">&lt;', $text{'delete'}, '&gt;';		}	}	print '</select></td>';	print "<td><input name=start_$i size=3 value='$range[0]'> -";	print "<input name=stop_$i size=3 value='$range[1]'> $text{'gen_skip'}\n";	print "<input name=skip_$i size=3 value='$range[2]'></td>\n";	print "<td><input name=name_$i size=15 value='$gv[1]'></td>\n";	print "<td><input name=value_$i size=15 value='$gv[3]'></td>\n";	if (! $dynamic && $config{'allow_comments'}) {		$comment = join(' ', @gv[4 .. $#gv]);		print "<td><input name=cmt_$i size=15 value='$comment'></td>\n";	}	print "</tr>\n";	$i++;}print '</table>';print '<table width=100%><tr>';$disabled = (! $access{'ro'}) ? '' : 'disabled';print "<td><input type=submit $disabled value=\"", $text{'save'}, '"></td>';$disabled = (@gens) ? '' : 'disabled';print "<td align=right><input type=submit $disabled name=show value=\"",      $text{'gen_show'}, '"></td>';print "</tr></table></form>\n";print '<hr>';&footer("edit_zone.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'type'}",	$text{'master_return'});exit;

⌨️ 快捷键说明

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