Changeset 815 for trunk/cgi-bin/IPDB.pm


Ignore:
Timestamp:
03/09/16 17:25:26 (8 years ago)
Author:
Kris Deugau
Message:

/trunk

Pass VRF in to add master page, and include it in the database checks. See #54.
Add missing breadcrumb links on add master entry and confirmation pages.

File:
1 edited

Legend:

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

    r814 r815  
    703703  eval {
    704704    # First check - does the master exist?  Ignore VRFs until we can see a sane UI
    705     my ($mcontained) = $dbh->selectrow_array("SELECT cidr FROM allocations WHERE cidr >>= ? AND type = 'mm'",
    706         undef, ($cidr) );
     705    my ($mcontained) = $dbh->selectrow_array("SELECT cidr FROM allocations WHERE cidr >>= ? AND type = 'mm' AND vrf = ?",
     706        undef, ($cidr, $args{vrf}) );
    707707    die "Master block $mcontained already exists and entirely contains $cidr\n"
    708708        if $mcontained;
    709709
    710710    # Second check - does the new master contain an existing one or ones?
    711     my ($mexist) = $dbh->selectrow_array("SELECT cidr FROM allocations WHERE cidr <<= ? AND type = 'mm'",
    712         undef, ($cidr) );
     711    my ($mexist) = $dbh->selectrow_array("SELECT cidr FROM allocations WHERE cidr <<= ? AND type = 'mm' AND vrf = ?",
     712        undef, ($cidr, $args{vrf}) );
    713713
    714714    if (!$mexist) {
Note: See TracChangeset for help on using the changeset viewer.