Ignore:
Timestamp:
12/11/13 16:01:18 (10 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Merge reverse DNS work and object conversion from /trunk, part 5

Includes changes through r543 with a few more minor conflicts.

Location:
branches/stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable

  • branches/stable/textrecs.cgi

    r547 r548  
    33##
    44# $Id$
    5 # Copyright 2012 Kris Deugau <kdeugau@deepnet.cx>
     5# Copyright 2012,2013 Kris Deugau <kdeugau@deepnet.cx>
    66#
    77#    This program is free software: you can redistribute it and/or modify
     
    5151
    5252# Check the session and if we have a zone ID to retrieve.  Call a failure sub if not.
    53 my $sid = ($webvar{sid} ? $webvar{sid} : undef);
     53my $sid = $q->cookie('dnsadmin_session');
    5454my $session = new CGI::Session("driver:File", $sid, {Directory => $dnsdb->{sessiondir}})
    5555        or die CGI::Session->errstr();
     
    6363
    6464##fixme:  do we support both HTML-plain and true plaintext?  could be done, with another $webvar{}
    65 # Don't die on bad parameters.  Saves munging the return from getDomRecs.
     65# Don't die on bad parameters.  Saves munging the return from getRecList.
    6666#my $page = HTML::Template->new(filename => "$templatedir/textrecs.tmpl",
    6767#       loop_context_vars => 1, global_vars => 1, die_on_bad_params => 0);
     
    7373print qq(Press the "Back" button to return to the standard record list.\n\n);
    7474
    75 my $reclist = $dnsdb->getDomRecs(defrec => $webvar{defrec}, revrec => $webvar{revrec}, id => $webvar{id},
     75my $reclist = $dnsdb->getRecList(defrec => $webvar{defrec}, revrec => $webvar{revrec}, id => $webvar{id},
    7676        sortby => ($webvar{revrec} eq 'n' ? 'type,host' : 'type,val'), sortorder => 'ASC');
    7777foreach my $rec (@$reclist) {
     
    8181  $rec->{val} = "$rec->{distance}  $rec->{val}" if $rec->{type} eq 'MX';
    8282  $rec->{val} = "$rec->{distance}  $rec->{weight}  $rec->{port}  $rec->{val}" if $rec->{type} eq 'SRV';
    83   printf "%-45s\t%d\t%s\t%s\n", $rec->{host}, $rec->{ttl}, $rec->{type}, $rec->{val};
     83  if ($webvar{revrec} eq 'y') {
     84    printf "%-16s\t%d\t%s\t%s\n", $rec->{val}, $rec->{ttl}, $rec->{type}, $rec->{host};
     85  } else {
     86    printf "%-45s\t%d\t%s\t%s\n", $rec->{host}, $rec->{ttl}, $rec->{type}, $rec->{val};
     87  }
    8488}
    8589#$page->param(defrec => ($webvar{defrec} eq 'y'));
Note: See TracChangeset for help on using the changeset viewer.