Changeset 397 for trunk/dns.cgi


Ignore:
Timestamp:
10/02/12 18:15:38 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Caught some inconsistencies getting the RPC CGI updated.

  • Normalize to use of odd in record list, same as other lists. Also normalize which case is which in templates so all lists look consistent.
  • Normalize calling convention and database calls in list-getting subs
    • getZoneList, with light tweak to template for field name
    • getDomRecs, with conversion from fixed arguments to hash
  • Normalize checks on list offsets to the best one, from getZoneList
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r392 r397  
    18701870  $page->param(ttl      => $soa->{ttl});
    18711871
    1872   my $foo2 = getDomRecs($dbh,$def,$rev,$id,$perpage,$webvar{offset},$sortby,$sortorder,$filter);
    1873 
    1874   my $row = 0;
     1872  my $foo2 = getDomRecs($dbh,(defrec => $def, revrec => $rev, id => $id, offset => $webvar{offset},
     1873        sortby => $sortby, sortorder => $sortorder, filter => $filter));
     1874
    18751875  foreach my $rec (@$foo2) {
    18761876    $rec->{type} = $typemap{$rec->{type}};
    1877     $rec->{row} = $row % 2;
    1878     $rec->{defrec} = $def;
    1879     $rec->{revrec} = $rev;
    18801877    $rec->{sid} = $webvar{sid};
    1881     $rec->{id} = $id;
    18821878    $rec->{fwdzone} = $rev eq 'n';
    18831879    $rec->{distance} = 'n/a' unless ($rec->{type} eq 'MX' || $rec->{type} eq 'SRV');
    18841880    $rec->{weight} = 'n/a' unless ($rec->{type} eq 'SRV');
    18851881    $rec->{port} = 'n/a' unless ($rec->{type} eq 'SRV');
    1886     $row++;
    18871882# ACLs
    18881883    $rec->{record_edit} = ($permissions{admin} || $permissions{record_edit});
Note: See TracChangeset for help on using the changeset viewer.