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

📄 edit_soa.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 the SOA for an existing master zone.#use strict;no strict 'vars';require './b9ddns-lib.pl';my $defttl = 0;my $conf = my $origin = my $view = my $file = '';my $rec = my $values = my $soa = my $time = my $unit = '';my $zone = my $zone_hdr = my $zone_ref = my $disabled = '';&ReadParse();$conf = &get_config();if ($in{'view'}) {	$view = $conf->[$in{'view'}];	$conf = $view->{'members'};}$zone = $conf->[$in{'index'}];$origin = lc($zone->{'value'});$origin .= '.' unless ($origin =~ /\.$/o);%access = &get_module_acl();unless (&can_edit_zone(\%access, $zone, $view)) {	&terror('master_ecannot');}unless ($access{'params'}) {	&terror('master_esoacannot');}$zone_ref = &get_zone_data($zone);$defttl = $zone_ref->[2];$rec = &get_soa_rec($zone, undef, $soa);if (ref($soa)) {	$values = $soa->{'values'};}else {	$soa = { };	$values = [ ];}$zone_hdr = &zone_header($in{'dynamic'}, $origin, $text{ucfirst($in{'type'})});&header($text{'master_params'}, '', undef, 0, 0, 0, undef, undef, undef, $zone_hdr);$zone_hdr = $origin;unless ($config{'display_fqdn'}) {	$zone_hdr = &convert_fqdn(-1, $zone_hdr, '.', 1);}print '<center><font size=+2>', $zone_hdr, "</font></center><hr>\n";$file = &find_value('file', $zone->{'members'});&seen_no_recs($file, &named_running(), $in{'type'}) unless ($rec);print '<form action=save_soa.cgi>';print '<input type=hidden name=file value="', $file, '">';print '<input type=hidden name=num value="', $soa->{'num'}, '">';print '<input type=hidden name=origin value="', $origin, '">';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=oldserial value="', $values->[2], '">';print '<table border width=100%>';print "<tr $tb><td><b>$text{'master_params'}</b></td></tr>\n";print "<tr $cb><td><table width=100% cellpadding=3>\n";print '<tr><td><b>', $text{'master_server'}, '</b></td>';print '<td><input name=master size=21 value="', $values->[0], '"></td>';$values->[1] = &dotted_to_email($values->[1]);print '<td><b>', $text{'master_email'}, '</b></td>';print '<td><input name=email size=21 value="', $values->[1], '"></td></tr>';print '<tr><td><b>', $text{'master_serial'}, '</b></td>';print '<td><input name=serial size=21 value="', $values->[2], '">';if ($config{'soa_date_style'}) {	print '&nbsp;&nbsp;(', $text{'date_based'};	$time = substr($values->[2], 0, 8);	if (&calc_secs($time) > time()) {		$unit = '';		if ($config{'serial_exceed99'} == 0) {			$unit = $text{'date_abort'};		}		elsif ($config{'serial_exceed99'} == 1) {			$unit = $text{'date_increment'};		}		elsif ($config{'serial_exceed99'} == 2) {			$unit = $text{'date_future'};		}		print '; ', $unit if ($unit);	}	print ')';}print '</td></tr>';($time, $unit) = &get_time($config{'display_ttl_secs'}, $values->[3]);$time = $text{'invalid'} unless ($time);print '<tr><td><b>', $text{'master_refresh'}, '</b></td>';print '<td><input name=refresh size=10 value="', $time, '">';&time_unit_choice('refunit', $unit);($time, $unit) = &get_time($config{'display_ttl_secs'}, $values->[4]);$time = $text{'invalid'} unless ($time);print '</td><td><b>', $text{'master_retry'}, '</b></td>';print '<td><input name=retry size=10 value="', $time, '">';&time_unit_choice('retunit', $unit);print "</td></tr>\n";($time, $unit) = &get_time($config{'display_ttl_secs'}, $values->[5]);$time = $text{'invalid'} unless ($time);print '<tr><td><b>', $text{'master_expiry'}, '</b></td>';print '<td><input name=expiry size=10 value="', $time, '">';&time_unit_choice('expunit', $unit);($time, $unit) = &get_time($config{'display_ttl_secs'}, $values->[6]);$time = $text{'invalid'} unless ($time);print '</td><td><b>', $text{'master_ncache'}, '</b></td>';print '<td><input name=ncache size=10 value="', $time, '">';&time_unit_choice('ncacheunit', $unit);print "</td></tr>\n";($time, $unit) = &get_time($config{'display_ttl_secs'}, $defttl);$time = $text{'invalid'} unless ($time);print '<tr><td><b>', $text{'master_defttl'}, '</b></td>';print '<td><input name=defttl disabled size=10 value="', $time, '">';&time_unit_choice('defttlunit', $unit, 1);print '</table></td></tr></table>';$disabled = ($access{'ro'} || $in{'dynamic'} == 2) ? 'disabled' : '';print "<input type=submit $disabled value=\"", $text{'save'}, '">';print "</form><p>\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 + -