Changeset 579 for trunk/cgi-bin


Ignore:
Timestamp:
12/28/12 16:52:45 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Pull back a little on making the VRF a key field; it's not yet
clear how the UI should present the restriction:

-> make VRF a layer above the master blocks?
-> present the VRF as a part of the master?
-> only use VRF as a key on private-net blocks? (pretty sane,

public IP space may lie in different VRFs but actually
allocating the same public IP in more than one VRF makes no
sense I can see)

-> ???

File:
1 edited

Legend:

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

    r578 r579  
    485485
    486486  # do it this way so we can waste a little less time iterating
    487   my $sth = $dbh->prepare("SELECT cidr FROM freeblocks WHERE parent = ? AND rdepth = ? AND vrf = ? ".
     487#  my $sth = $dbh->prepare("SELECT cidr FROM freeblocks WHERE parent = ? AND rdepth = ? AND vrf = ? ".
     488  my $sth = $dbh->prepare("SELECT cidr FROM freeblocks WHERE parent = ? AND rdepth = ? ".
    488489        "ORDER BY cidr");
    489   $sth->execute($args{master}, $args{rdepth}, $args{vrf});
     490#  $sth->execute($args{master}, $args{rdepth}, $args{vrf});
     491  $sth->execute($args{master}, $args{rdepth});
    490492  my @flist;
    491493  while (my ($cidr) = $sth->fetchrow_array()) {
     
    10591061  return ('FAIL', 'No fields to update') if !@fieldlist;
    10601062
    1061   push @vallist, $args{block}, $args{rdepth}, $args{vrf};
     1063#  push @vallist, $args{block}, $args{rdepth}, $args{vrf};
     1064  push @vallist, $args{block}, $args{rdepth};
    10621065  my $sql = "UPDATE $updtable SET ";
    10631066  $sql .= join " = ?, ", @fieldlist;
    1064   $sql .= " = ? WHERE $keyfield = ? AND rdepth = ? AND vrf = ?";
     1067#  $sql .= " = ? WHERE $keyfield = ? AND rdepth = ? AND vrf = ?";
     1068  $sql .= " = ? WHERE $keyfield = ? AND rdepth = ? ";
    10651069
    10661070  eval {
     
    13631367    my $binfo = $dbh->selectrow_hashref("SELECT cidr AS block, 'mm' AS type, 0 AS parent, cidr,".
    13641368        " ctime, mtime, rwhois, vrf".
    1365         " FROM masterblocks WHERE cidr = ? AND vrf = ?", undef, ($block, $vrf) );
     1369        " FROM masterblocks WHERE cidr = ?", undef, ($block) );
     1370#       " FROM masterblocks WHERE cidr = ? AND vrf = ?", undef, ($block, $vrf) );
    13661371    return $binfo;
    13671372  } elsif ($btype =~ /^.i$/) {
    13681373    my $binfo = $dbh->selectrow_hashref("SELECT ip AS block, custid, type, city, circuitid, description,".
    13691374        " notes, modifystamp AS lastmod, privdata, vrf, pool, rdepth".
    1370         " FROM poolips WHERE ip = ? AND vrf = ?", undef, ($block, $vrf) );
     1375        " FROM poolips WHERE ip = ?", undef, ($block) );
     1376#       " FROM poolips WHERE ip = ? AND vrf = ?", undef, ($block, $vrf) );
    13711377    return $binfo;
    13721378  } else {
Note: See TracChangeset for help on using the changeset viewer.