📄 master_form.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.### Form for creating a new master zone.#use strict;no strict 'vars';require './b9ddns-lib.pl';my $conf = my $view = my $server = my $time = my $unit = '';my $disabled = '';my @views = my @servers = ();my %zone_default = ();&ReadParse();%access = &get_module_acl();unless ($access{'master'}) { &terror('mcreate_ecannot');}$conf = &get_config();@views = &find('view', $conf);&header($text{'mcreate_title'}, '');print '<hr>';print '<form action=create_master.cgi>';print '<table border width=100%>';print "<tr><td $tb><b>$text{'mcreate_opts'}</b></td></tr>\n";print "<tr><td $cb><table width=100%>\n";print '<tr><td><b>', $text{'mcreate_type'}, '</b></td>';print '<td colspan=3><input type=radio name=rev value=0 checked> ', $text{'mcreate_fwd'};print ' <input type=radio name=rev value=1> ', $text{'mcreate_rev'}, "</td></tr>\n";print '<tr><td><b>', $text{'mcreate_dom'}, '</b></td>';print '<td colspan=3><input name=zone size=40></td></tr>';if (@views) { print '<tr><td><b>', $text{'mcreate_view'}, '</b></td>'; print '<td colspan=3><select name=view>'; foreach $view (grep { &can_edit_view(\%access, $_) } @views) { printf "<option value=%d>%s\n", $view->{'index'}, $view->{'value'}; } print "</select></td></tr>\n";}print '<tr><td><b>', $text{'mcreate_file'}, '</b></td><td colspan=3>';print '<input type=radio name=file_def value=1 checked> ', $text{'mcreate_auto'};print '<input type=radio name=file_def value=0>';print '<input name=file size=30>', &file_chooser_button('file'), '</td></tr>';$server = ($config{'default_master_srvr'}) ? $config{'default_master_srvr'} : &get_system_hostname();$server .= '.' unless ($server =~ /\.$/o);print '<tr><td><b>', $text{'master_server'}, '</b></td>';printf '<td colspan=3><input name=master size=30 value="%s"> ', $server;print '<input type=checkbox name=master_ns value=1 checked> ', $text{'master_ns'}, "</td></tr>\n";&foreign_require('servers', 'servers-lib.pl');@servers = grep { $_->{'user'} } &servers::list_servers();$disabled = (@servers && $access{'remote'}) ? '' : 'disabled';print '<tr><td valign=top><b>', $text{'master_slave'}, '</b></td>';print "<td colspan=3><select name=slave $disabled>";print '<option value="">', ' ' x 30;foreach $server (@servers) { printf "<option value=%s %s>%s\n", $server->{'host'}, ($server->{'host'} eq $config{'default_slave'}) ? 'selected' : '', $server->{'desc'} ? $server->{'desc'} : $server->{'host'};}print '</select> ', $text{'master_mip'};print " <input name=masters $disabled size=30 value='", &to_ipaddress(&get_system_hostname()), "'><br>";print '<b>', $text{'slave_file'}, '</b>';print "<input type=radio $disabled name=sfile_def value=1> ", $text{'slave_none'};print "<input type=radio $disabled name=sfile_def value=2 checked>", $text{'slave_auto'};print " <input type=radio $disabled name=sfile_def value=0>";print "<input name=sfile $disabled size=30></td></tr>";print "<tr><td><b>$text{'master_email'}</b></td>\n";print '<td colspan=3><input name=email size=40 value="', $config{'soa_email'}, '"></td></tr>';print '<tr><td><b>', $text{'master_tmpl'}, '</b></td>';printf '<td><input type=radio name=tmpl value=1 %s> %s', &checked($config{'tmpl_0'} || $config{'tmpl_include'}), $text{'yes'};printf '<input type=radio name=tmpl value=0 %s> %s</td>', &checked(! $config{'tmpl_0'} && ! $config{'tmpl_include'}), $text{'no'};print '<td><b>', $text{'master_ip'}, '</b></td>';print "<td><input name=ip size=15></td></tr>\n";&get_zone_defaults(\%zone_default);($time, $unit) = &get_time($config{'display_ttl_secs'}, $zone_default{'refresh'} . $zone_default{'refunit'});$time = ${'invalid'} unless ($time);print '<tr><td><b>', $text{'master_refresh'}, '</b></td>';print '<td><input name=refresh size=8 value=', $time, '>';&time_unit_choice('refunit', $unit);print "</td>\n";($time, $unit) = &get_time($config{'display_ttl_secs'}, $zone_default{'retry'} . $zone_default{'retunit'});$time = ${'invalid'} unless ($time);print '<td><b>', $text{'master_retry'}, '</b></td>';print '<td><input name=retry size=8 value=', $time, '>';&time_unit_choice('retunit', $unit);print "</td></tr>\n";($time, $unit) = &get_time($config{'display_ttl_secs'}, $zone_default{'expiry'} . $zone_default{'expunit'});$time = ${'invalid'} unless ($time);print '<tr><td><b>', $text{'master_expiry'}, '</b></td>';print '<td><input name=expiry size=8 value=', $time, '>';&time_unit_choice('expunit', $unit);print "</td>\n";($time, $unit) = &get_time($config{'display_ttl_secs'}, $zone_default{'ncache'} . $zone_default{'ncacheunit'});$time = ${'invalid'} unless ($time);print '<td><b>', $text{'master_ncache'}, '</b></td>';print '<td><input name=ncache size=8 value=', $time, '>';&time_unit_choice('ncacheunit', $unit);print "</td></tr>\n";($time, $unit) = &get_time($config{'display_ttl_secs'}, $zone_default{'defttl'} . $zone_default{'defttlunit'});$time = ${'invalid'} unless ($time);print '<tr><td><b>', $text{'master_defttl'}, '</b></td>';print '<td><input name=defttl size=8 value=', $time, '>';&time_unit_choice('defttlunit', $unit);print "</td></tr>\n";print '</table></td></tr></table>';print '<input type=submit value="', $text{'create'}, '"></form>';print '<hr>';&footer('', $text{'index_return'});exit;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -