Changeset 422 for branches/stable/textrecs.cgi
- Timestamp:
- 10/10/12 13:41:00 (12 years ago)
- Location:
- branches/stable
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/stable
-
branches/stable/textrecs.cgi
r420 r422 46 46 # shut up some warnings, in case we arrive somewhere we forgot to set this 47 47 $webvar{defrec} = 'n' if !$webvar{defrec}; # non-default records 48 $webvar{revrec} = 'n' if !$webvar{revrec}; # non-reverse (domain) records48 #$webvar{revrec} = 'n' if !$webvar{revrec}; # non-reverse (domain) records 49 49 50 50 # load some local system defaults (mainly DB connect info) … … 70 70 71 71 my $zone; 72 $zone = ($webvar{revrec} eq 'n' ? domainName($dbh, $webvar{id}) : revName($dbh, $webvar{id})) 73 if $webvar{defrec} eq 'n'; 72 $zone = domainName($dbh, $webvar{id}) if $webvar{defrec} eq 'n'; 74 73 $zone = "group ".groupName($dbh, $webvar{id}) if $webvar{defrec} eq 'y'; 75 74 … … 82 81 print "Content-type: text/plain\n\n"; 83 82 print "Plaintext version of records for $zone.\n" if $webvar{defrec} eq 'n'; 84 print "Plaintext version of default ".($webvar{revrec} eq 'y' ? 'reverse ' : '')."records for $zone.\n" 85 if $webvar{defrec} eq 'y'; 83 print "Plaintext version of default records for $zone.\n" if $webvar{defrec} eq 'y'; 86 84 print qq(Press the "Back" button to return to the standard record list.\n\n); 87 85 88 my $reclist = getDomRecs($dbh, (defrec => $webvar{defrec}, revrec => $webvar{revrec}, id => $webvar{id},89 sortby => ($webvar{revrec} eq 'n' ? 'type,host' : 'type,val'), sortorder => 'ASC') ); 86 my $reclist = getDomRecs($dbh, $webvar{defrec}, $webvar{id}, 0, 'all', 'type,host', 'ASC'); 87 90 88 foreach my $rec (@$reclist) { 91 89 $rec->{type} = $typemap{$rec->{type}}; 92 $rec->{val} .= '.' if $rec->{type} ne 'A' && $ webvar{revrec} eq 'n' && $rec->{val} !~ /\.$/;93 $rec->{host} .= '.' if $ webvar{revrec} eq 'y' && $rec->{val} !~ /\.$/;90 $rec->{val} .= '.' if $rec->{type} ne 'A' && $rec->{val} !~ /\.$/; 91 $rec->{host} .= '.' if $rec->{val} !~ /\.$/; 94 92 $rec->{val} = "$rec->{distance} $rec->{val}" if $rec->{type} eq 'MX'; 95 93 $rec->{val} = "$rec->{distance} $rec->{weight} $rec->{port} $rec->{val}" if $rec->{type} eq 'SRV';
Note:
See TracChangeset
for help on using the changeset viewer.