📄 edit_text.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 a form for manually editing a records file.#use strict;no strict 'vars';require './b9ddns-lib.pl';my $conf = my $zone_conf = my $view = my $file = my $fn = my $line = '';my $origin = my $zone = my $zone_hdr = my $read_only = my $type = '';my @lines = ();&ReadParse();$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);$file = &absolute_path($in{'file'});($fn) = $file =~ /([^\/]+)$/o;%access = &get_module_acl();unless (&can_edit_zone(\%access, $zone, $view)) { &terror('master_ecannot');}unless ($access{'file'}) { &terror('text_ecannot');}$type = $in{'type'};$read_only = ($access{'ro'} || $in{'dynamic'} || ($type ne 'master' && $type ne 'hint')) ? 'disabled' : '';if (open(FILE, $config{'chroot'} . $file)) { while (defined($line = <FILE>)) { push(@lines, &html_escape($line)); } close(FILE);}else { $line = $!; &terror('xfr_file_open', $fn, $line);}$zone_hdr = &zone_header($in{'dynamic'}, $origin, $text{ucfirst($type)});&header($text{'text_title'}, '', undef, 0, 0, 0, undef, undef, undef, $zone_hdr);print '<center><font size=+1>', $fn, '</font></center><hr>';unless ($read_only) { print '<center>', &text('text_desc'); print &text('text_desc_soa') unless ($type eq 'hint'); print '.</center><p>';}print '<form action=save_text.cgi method=post enctype=multipart/form-data>';print '<input type=hidden name=index value="', $in{'index'}, '">';print '<input type=hidden name=view value="', $in{'view'}, '">';print '<input type=hidden name=file value="', $file, '">';print '<input type=hidden name=type value="', $type, '">';print '<textarea name=text rows=20 cols=80>', join('', @lines), '</textarea><p>';print "<input type=submit $read_only value=\"", $text{'save'}, '"> ', "<input type=reset value=\"", $text{'text_undo'}, '">';print "</form>\n";print '<hr>';&footer("edit_zone.cgi?index=$in{'index'}&view=$in{'view'}&type=$type", $text{'master_return'});exit;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -