Changeset 677 for trunk


Ignore:
Timestamp:
01/16/15 17:34:45 (10 years ago)
Author:
Kris Deugau
Message:

/trunk

Collect and pass through per-IP rDNS. Still need to cache these locally.
See #1.

Location:
trunk/cgi-bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r676 r677  
    11491149      if $args{rdns};
    11501150
     1151    # and the per-IP set, if there is one.
     1152    _rpc('updateRevSet', %{$args{iprev}}, rpcuser => $args{user});
     1153
    11511154    return ('OK', 'OK');
    11521155
     
    12961299  $binfo->{block} =~ s|/32$||;
    12971300  _rpc('addOrUpdateRevRec', cidr => $binfo->{block}, name => $args{rdns}, rpcuser => $args{user});
     1301
     1302  # and the per-IP set, if there is one.
     1303  _rpc('updateRevSet', %{$args{iprev}}, rpcuser => $args{user});
     1304
    12981305  return ('OK','OK');
    12991306} # end updateBlock()
  • trunk/cgi-bin/main.cgi

    r675 r677  
    551551  # IP, or the error message if an error occurred.
    552552
     553##fixme:  consider just passing \%webvar to allocateBlock()?
     554  # collect per-IP rDNS fields.  only copy over the ones that actually have something in them.
     555  my %iprev;
     556  foreach (keys %webvar) {
     557    $iprev{$_} = $webvar{$_} if /host_[\d.a-fA-F:]+/ && $webvar{$_};
     558  }
     559
    553560  my ($code,$msg) = allocateBlock($ip_dbh, cidr => $webvar{fullcidr}, fbid => $webvar{fbid},
    554561        parent => $webvar{parent}, custid => $webvar{custid}, type => $webvar{alloctype}, city => $webvar{city},
    555562        desc => $webvar{desc}, notes => $webvar{notes}, circid => $webvar{circid},
    556         privdata => $webvar{privdata}, nodeid => $webvar{node}, rdns => $webvar{rdns}, user => $authuser);
     563        privdata => $webvar{privdata}, nodeid => $webvar{node}, rdns => $webvar{rdns}, user => $authuser,
     564        iprev => \%iprev);
    557565
    558566  if ($code eq 'OK') {
     
    804812  $updargs{node} = $webvar{node} if $webvar{node};
    805813
    806   my ($code,$msg) = updateBlock($ip_dbh, %updargs);
     814  # collect per-IP rDNS fields.  only copy over the ones that actually have something in them.
     815  my %iprev;
     816  foreach (keys %webvar) {
     817    $iprev{$_} = $webvar{$_} if /host_[\d.a-fA-F:]+/ && $webvar{$_};
     818  }
     819
     820  my ($code,$msg) = updateBlock($ip_dbh, %updargs, iprev => \%iprev);
    807821
    808822  if ($code eq 'FAIL') {
Note: See TracChangeset for help on using the changeset viewer.