Ignore:
Timestamp:
10/10/12 13:41:00 (12 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Merge plaintext record list feature from /trunk r420 and r421,
with minor changes to account for no reverse records.
Bump patch version.

Location:
branches/stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable

  • branches/stable/DNSDB.pm

    r419 r422  
    3232use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
    3333
    34 $VERSION        = 1.0.2;        ##VERSION##
     34$VERSION        = 1.0.3;        ##VERSION##
    3535@ISA            = qw(Exporter);
    3636@EXPORT_OK      = qw(
     
    13151315  $sql .= "default_" if $type eq 'y';
    13161316  $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
    13171327  $sql .= "INNER JOIN rectypes t ON r.type=t.val ";     # for sorting by type alphabetically
    13181328  if ($type eq 'y') {
     
    13241334  $sql .= " AND host ~* ?" if $filter;
    13251335  # 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";
    13271337  $sql .= " LIMIT $nrecs OFFSET ".($nstart*$nrecs) if $nstart ne 'all';
    13281338
Note: See TracChangeset for help on using the changeset viewer.