Changeset 787
- Timestamp:
- 08/23/19 15:24:59 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r786 r787 5497 5497 ## DNSDB::getZonesByCIDR() 5498 5498 # Get a list of zone names and IDs that records for a passed CIDR block are within. 5499 # Optionally restrict to a specific location/view 5500 # Optionally leave off the default_location field 5499 # Arguments must be passed in a hash 5500 # Requires an argument "cidr" for the CIDR block to find parent/child zone(s) for 5501 # Accepts optional arguments: 5502 # - return_location: Flag indicating whether to return default_location or not 5503 # - location: Restrict matches to a particular location/view 5504 # - sort: Valid values are ASC or DESC; if omitted or set to something else 5505 # results will be "whatever the database returns" 5501 5506 sub getZonesByCIDR { 5502 5507 my $self = shift; … … 5508 5513 " FROM revzones WHERE (revnet >>= ? OR revnet <<= ?)". 5509 5514 (defined($args{location}) ? " AND default_location = ?" : ''); 5515 if ($args{sort}) { 5516 if ($args{sort} eq 'ASC' || $args{sort} eq 'DESC') { 5517 $sql .= " ORDER BY revnet $args{sort}"; 5518 } 5519 } 5510 5520 my @svals = ($args{cidr}, $args{cidr}); 5511 5521 push @svals, $args{location} if defined $args{location};
Note:
See TracChangeset
for help on using the changeset viewer.