Changeset 674 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
01/14/15 12:58:58 (10 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.