Changeset 915 for trunk/cgi-bin/IPDB.pm
- Timestamp:
- 04/27/18 15:28:45 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r913 r915 35 35 &getBlockRDNS &getRDNSbyIP &getRevID 36 36 &getNodeList &getNodeName &getNodeInfo 37 &getBlockNotices 37 38 &mailNotify 38 39 ); … … 51 52 &getBlockRDNS &getRDNSbyIP &getRevID 52 53 &getNodeList &getNodeName &getNodeInfo 54 &getBlockNotices 53 55 &mailNotify 54 56 )] … … 3553 3555 3554 3556 3557 ## IPDB::getBlockNotices() 3558 # Retrieve any infonotes for a block and all of its parents 3559 # Takes the block ID to trace down the stack 3560 # Returns an arrayref to the block and all of its parents, containing the CIDR, 3561 # description, and notice (if any) associated to each block. 3562 sub getBlockNotices { 3563 my $dbh = shift; 3564 my $bid = shift; 3565 my $nlist = $dbh->selectall_arrayref(q( 3566 WITH RECURSIVE blockparents (id, cidr, description, parent_id, notice, depth) AS ( 3567 SELECT a.id, a.cidr, a.description, a.parent_id, bn.notice, 1 AS depth FROM allocations a 3568 LEFT JOIN blocknotices bn ON a.id = bn.alloc_id 3569 WHERE a.id = ? 3570 UNION 3571 SELECT b.id, b.cidr, b.description, b.parent_id, bn2.notice, t.depth AS depth FROM allocations b 3572 JOIN blockparents t ON t.parent_id = b.id 3573 LEFT JOIN blocknotices bn2 ON b.id = bn2.alloc_id 3574 ) SELECT id, cidr, description, parent_id, notice FROM blockparents ORDER BY depth DESC; 3575 ), {Slice=>{}}, $bid); 3576 3577 return $nlist; 3578 } # end getBlockNotices() 3579 3580 3555 3581 ## IPDB::mailNotify() 3556 3582 # Sends notification mail to recipients regarding an IPDB operation
Note:
See TracChangeset
for help on using the changeset viewer.