Ignore:
Timestamp:
02/19/10 13:10:34 (14 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Basic support for network node references: Add, view, edit nodes and

referencess

Probably excludes a bunch of real use-cases for various reasons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/IPDB.pm

    r387 r394  
    292292# Returns a success code and optional error message.
    293293sub allocateBlock {
    294   my ($dbh,undef,undef,$custid,$type,$city,$desc,$notes,$circid,$privdata) = @_;
     294  my ($dbh,undef,undef,$custid,$type,$city,$desc,$notes,$circid,$privdata,$nodeid) = @_;
    295295
    296296  my $cidr = new NetAddr::IP $_[1];
     
    333333        " where ip='$cidr'");
    334334      $sth->execute;
     335# node hack
     336      if ($nodeid && $nodeid ne '') {
     337        $sth = $dbh->prepare("INSERT INTO noderef (block,node_id) VALUES (?,?)");
     338        $sth->execute("$cidr",$nodeid);
     339      }
     340# end node hack
    335341      $dbh->commit;
    336342    };
     
    393399        } # routing vs non-routing netblock
    394400
     401# node hack
     402      if ($nodeid && $nodeid ne '') {
     403        $sth = $dbh->prepare("INSERT INTO noderef (block,node_id) VALUES (?,?)");
     404        $sth->execute("$cidr",$nodeid);
     405      }
     406# end node hack
    395407        $dbh->commit;
    396408      }; # end of eval
     
    497509        } # done with netblock alloctype != rm
    498510
     511# node hack
     512      if ($nodeid && $nodeid ne '') {
     513        $sth = $dbh->prepare("INSERT INTO noderef (block,node_id) VALUES (?,?)");
     514        $sth->execute("$cidr",$nodeid);
     515      }
     516# end node hack
    499517        $dbh->commit;
    500518      }; # end eval
Note: See TracChangeset for help on using the changeset viewer.