📄 find_zones.cgi
字号:
#! /usr/bin/perl## B9DDNS - BIND 9 dynamic DNS webmin module.# Copyright (C) 2003 John Horne. <john.horne@plymouth.ac.uk># Copyright (C) 2004 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 zones matching some search pattern.#use strict;no strict 'vars';require './b9ddns-lib.pl';my $mid = my $found = my $find_all = 0;my $conf = my $zone = my $vw = my $value = my $type = my $search = '';my $zone_title = my $url = my $spaces = my $v = '';my @zones = my @views = my @view_zones = ();my @zlinks = my @ztitles = my @zicons = my @ztypes = ();my @zorder = my @zsort = ();my %view = ();&ReadParse();%access = &get_module_acl();$conf = &get_config();$search = lc($in{'search'});&trim($search);$find_all++ unless ($search);@views = &find('view', $conf);foreach $vw (@views) { @view_zones = &find('zone', $vw->{'members'}); map { $view{$_} = $vw } @view_zones; push(@zones, @view_zones);}push(@zones, &find('zone', $conf));$spaces = ' ' x 4;foreach $zone (@zones) { $value = lc($zone->{'value'}); unless ($find_all) { if ($value eq '.') { next unless ($search eq 'root' || $search eq 'hint'); } else { next unless ($value =~ /$search/); } } next unless (&can_edit_zone(\%access, $zone, $view{$zone})); $type = &find_value('type', $zone->{'members'}); $url = 'edit_zone.cgi?index=' . $zone->{'index'} . '&type=' . $type; if ($value eq '.') { $zone_title = '<i>' . $text{'index_root'} . '</i>'; } else { $zone_title = $value; $zone_title .= '.' unless ($zone_title =~ /\.$/o); unless ($config{'display_fqdn'}) { $zone_title = &convert_fqdn(-1, $zone_title, '.', 1); } } $vname = ''; if ($view{$zone}) { $v = $view{$zone}; $url .= '&view=' . $v->{'index'}; $vname = $v->{'value'}; unless ($config{'show_list'}) { $zone_title .= $spaces . '(' . $vname . ')'; } } push(@zlinks, $url); push(@ztitles, $zone_title); push(@zsort, $type eq 'hint' ? undef : $zone_title); push(@zicons, "images/$type.gif"); push(@vnames, $vname); if ($type eq 'master' || $type eq 'slave') { $v = ((&dynamic_zone($zone, 0) > 0) ? $text{'Dynamic'} : $text{'Static'}) . ' '; } else { $v = ''; } $v .= $text{"index_$type"}; push(@ztypes, $v); $found++;}if (@zlinks == 1) { &redirect($zlinks[0]); exit;}&header($text{'find_title'}, '');print '<hr>';if ($found) { print '<p>', (($find_all) ? &text('find_all') : &text('find_match', $found, "<i>$search</i>")), '<p>'; @zorder = sort { &compare_zones($zsort[$a], $zsort[$b]) } (0 .. $found - 1); @zlinks = map { $zlinks[$_] } @zorder; @ztitles = map { $ztitles[$_] } @zorder; @zicons = map { $zicons[$_] } @zorder; @ztypes = map { $ztypes[$_] } @zorder; @vnames = map { $vnames[$_] } @zorder; if ($config{'show_list'}) { # # Display as a list. # $mid = int((@zlinks + 1) / 2); print '<table width=100%><tr><td width=50% valign=top>'; &zones_table([ @zlinks[0 .. $mid - 1] ], [ @ztitles[0 .. $mid - 1] ], [ @vnames[0 .. $mid - 1] ], [ @ztypes[0 .. $mid - 1] ]); print '</td><td width=50% valign=top>'; if ($mid < @zlinks) { &zones_table([ @zlinks[$mid .. $#zlinks] ], [ @ztitles[$mid .. $#ztitles] ], [ @vnames[$mid .. $#vnames] ], [ @ztypes[$mid .. $#ztypes] ]); } print "</td></tr></table>\n"; } else { # # Display as icons. # &icons_table(\@zlinks, \@ztitles, \@zicons, 5); }}else { print '<p>', &text('find_none', "<i>$search</i>"), "<p>\n";}print '<hr>';&footer('', $text{'index_return'});exit;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -