Changeset 422
- Timestamp:
- 10/10/12 13:41:00 (12 years ago)
- Location:
- branches/stable
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/stable
-
branches/stable/DNSDB.pm
r419 r422 32 32 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); 33 33 34 $VERSION = 1.0. 2; ##VERSION##34 $VERSION = 1.0.3; ##VERSION## 35 35 @ISA = qw(Exporter); 36 36 @EXPORT_OK = qw( … … 1315 1315 $sql .= "default_" if $type eq 'y'; 1316 1316 $sql .= "records r "; 1317 1318 # whee! multisort means just passing comma-separated fields in sortby! 1319 my $newsort = ''; 1320 foreach my $sf (split /,/, $order) { 1321 $sf = "r.$sf"; 1322 $sf =~ s/r\.type/t.alphaorder/; 1323 $newsort .= ",$sf"; 1324 } 1325 $newsort =~ s/^,//; 1326 1317 1327 $sql .= "INNER JOIN rectypes t ON r.type=t.val "; # for sorting by type alphabetically 1318 1328 if ($type eq 'y') { … … 1324 1334 $sql .= " AND host ~* ?" if $filter; 1325 1335 # use alphaorder column for "correct" ordering of sort-by-type instead of DNS RR type number 1326 $sql .= " ORDER BY ".($order eq 'type' ? 't.alphaorder' : "r.$order")."$direction";1336 $sql .= " ORDER BY $newsort $direction"; 1327 1337 $sql .= " LIMIT $nrecs OFFSET ".($nstart*$nrecs) if $nstart ne 'all'; 1328 1338 -
branches/stable/Makefile
r419 r422 3 3 4 4 PKGNAME=dnsadmin 5 VERSION=1.0. 25 VERSION=1.0.3 6 6 RELEASE=1 7 7 -
branches/stable/templates/reclist.tmpl
r151 r422 44 44 </tr> 45 45 <tr class="darkrowheader"> 46 <td colspan="4">Records</td> 46 <td colspan="3">Records</td> 47 <td align="center"><a href="textrecs.cgi?sid=<TMPL_VAR NAME=sid>&id=<TMPL_VAR NAME=id>&defrec=<TMPL_VAR NAME=defrec>">Plain text</a></td> 47 48 <TMPL_IF record_create> <td align="right"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&page=record&parentid=<TMPL_VAR NAME=id>&defrec=<TMPL_VAR NAME=defrec>&recact=new">Add record</a></td></TMPL_IF> 48 49 <td align="right"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&page=log&id=<TMPL_VAR NAME=id><TMPL_IF logdom>&ltype=dom</TMPL_IF>">View log</a></td> -
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.