Changeset 890 for trunk/cgi-bin
- Timestamp:
- 09/02/16 16:29:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/ipdb-rpc.cgi
r886 r890 462 462 die "IP to search for required\n" if !$args{ip} || $args{ip} !~ /^\d+\.\d+\.\d+\.\d+$/; 463 463 464 my $sql = "SELECT cidr,custid,type FROM searchme WHERE cidr >>= ?"; 464 my $sql = q(SELECT s.cidr,s.custid,s.type,s.description,a.dispname 465 FROM searchme s 466 JOIN alloctypes a ON s.type = a.type 467 WHERE cidr >>= ?); 465 468 # first, check if it's even on our network 466 my $isours = $ip_dbh->selectall_arrayref($sql." AND type = 'mm'", undef, $args{ip});469 my $isours = $ip_dbh->selectall_arrayref($sql." AND s.type = 'mm'", undef, $args{ip}); 467 470 die $ip_dbh->errstr."\n" if $ip_dbh->err; # do we care? 468 471 die "IP not on our network\n" if !@$isours; 469 472 470 473 # now, find the specific allocation 471 my $result = $ip_dbh->selectall_arrayref($sql." AND NOT type LIKE '_m' ORDER BY cidr DESC",474 my $result = $ip_dbh->selectall_arrayref($sql." AND NOT s.type LIKE '_m' ORDER BY cidr DESC", 472 475 { Slice => {} }, $args{ip}); 473 476 die $ip_dbh->errstr."\n" if $ip_dbh->err;
Note:
See TracChangeset
for help on using the changeset viewer.