Changeset 674 for trunk/cgi-bin


Ignore:
Timestamp:
01/14/15 12:58:58 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Start extending rDNS support to allow entering per-IP reverse names. See #1.

  • configuration for maximum IP list length
  • CSS to support hideable space so longer lists don't distort and confuse the page too much
  • Hideable space on the assignment confirmation page for per-IP fields
  • Generate IP list for assignment confirmation - note we can't do it on the previous page without heavy AJAX (or heavier Javascript) because we don't know what block we're even assigning at that stage.
Location:
trunk/cgi-bin
Files:
3 edited

Legend:

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

    r671 r674  
    9999our $revgroup = 1;      # should probably be configurable somewhere
    100100our $rpccount = 0;
     101
     102# Largest inverse CIDR mask length to show per-IP rDNS list
     103# (eg, NetAddr::IP->bits - NetAddr::IP->masklen)
     104our $maxrevlist = 5;  # /27
    101105
    102106##
  • trunk/cgi-bin/MyIPDB.pm

    r667 r674  
    7272#$IPDB::rpc_url = 'http://dnsadmin.example.com/dns-rpc.cgi';
    7373
     74# Largest inverse CIDR mask length to show per-IP rDNS list
     75# (eg, NetAddr::IP->bits - NetAddr::IP->masklen)
     76# allowing longer than a /27 is probably going to slow things down;  longer than /29 will scroll.
     77#$IPDB::maxrevlist = 8;  # v4 /24
     78
    7479## connectDB_My()
    7580# Wrapper for IPDB::connectDB
  • trunk/cgi-bin/main.cgi

    r665 r674  
    462462    } # check for freeblocks assignment or IPDB-controlled assignment
    463463
     464    # Generate the IP list for the new allocation in case someone wants to set per-IP rDNS right away.
     465    # We don't do this on the previous page because we don't know how big a block or even what IP range
     466    # it's for (if following the "normal" allocation process)
     467    if ($IPDBacl{$authuser} =~ /c/
     468        && $cidr->masklen != $cidr->bits
     469        && ($cidr->bits - $cidr->masklen) <= $IPDB::maxrevlist
     470        && $webvar{alloctype} !~ /^.[dpi]/
     471        # do we want to allow v6 at all?
     472        #&& ! $cidr->{isv6}
     473        ) {
     474      my @list;
     475      foreach my $ip (@{$cidr->splitref()}) {
     476        my %row;
     477        $row{r_ip} = $ip->addr;
     478        $row{iphost} = '';
     479        push @list, \%row;
     480      }
     481      $page->param(r_iplist => \@list);
     482      # We don't use this here, because these IPs should already be bare.
     483      # ... or should we be paranoid?  Make it a config option?
     484      #getRDNSbyIP($ip_dbh, type => $webvar{alloctype}, range => "$cidr", user => $authuser) );
     485    }
    464486  } # if ($webvar{alloctype} =~ /^.i$/)
    465487
Note: See TracChangeset for help on using the changeset viewer.