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


Ignore:
Timestamp:
11/27/07 12:18:27 (17 years ago)
Author:
Kris Deugau
Message:

/trunk

Merge bugfixes and enhancements from /branches/stable r351 through r359

File:
1 edited

Legend:

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

    r350 r370  
    2525        %allocated %free %routed %bigfree %IPDBacl
    2626        &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock &deleteBlock
    27         &mailNotify
     27        &getBlockData &mailNotify
    2828        );
    2929
     
    3333                @masterblocks %allocated %free %routed %bigfree %IPDBacl
    3434                &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock
    35                 &deleteBlock &mailNotify
     35                &deleteBlock &getBlockData &mailNotify
    3636                )]
    3737        );
     
    492492      $msg = "Unable to deallocate $disp_alloctypes{$type} $cidr";
    493493      $sth = $dbh->prepare("update poolips set custid='6750400',available='y',".
    494         "city=(select city from allocations where cidr >>= '$cidr'),".
     494        "city=(select city from allocations where cidr >>= '$cidr'".
     495        " order by masklen(cidr) desc limit 1),".
    495496        "description='',notes='',circuitid='' where ip='$cidr'");
    496497      $sth->execute;
     
    643644
    644645
     646## IPDB::getBlockData()
     647# Return custid, type, city, and description for a block
     648sub getBlockData {
     649  my $dbh = shift;
     650  my $block = shift;
     651
     652  my $sth = $dbh->prepare("select cidr,custid,type,city,description from searchme".
     653        " where cidr='$block'");
     654  $sth->execute();
     655  return $sth->fetchrow_array();
     656} # end getBlockData()
     657
     658
    645659## IPDB::mailNotify()
    646660# Sends notification mail to recipients regarding an IPDB operation
Note: See TracChangeset for help on using the changeset viewer.