- # This should catch errors in the ip_addr and ip_netmask. If it doesn't,
- # they'll almost certainly not map into a valid block anyway.
- my $self_addr = new NetAddr::IP ($self->ip_addr, $self->ip_netmask);
- return 'Cannot parse address: ' . $self->ip_addr . '/' . $self->ip_netmask unless $self_addr;
-
- my @block = grep {
- my $block_addr = new NetAddr::IP ($_->ip_gateway, $_->ip_netmask);
- if ($block_addr->contains($self_addr)) { $_ };
- } qsearch( 'ac_block', { acnum => $self->acnum });
-
- if(scalar @block == 0) {
- return 'Block not found for address '.$self->ip_addr.' in actype '.$self->actypenum;
- } elsif(scalar @block > 1) {
- return 'ERROR: Intersecting blocks found for address '.$self->ip_addr.' :'.
- join ', ', map {$_->ip_addr . '/' . $_->ip_netmask} @block;
+ if($self->latitude < -90 || $self->latitude > 90) {
+ return 'latitude must be between -90 and 90';
+ }
+ if($self->longitude < -180 || $self->longitude > 180) {
+ return 'longitude must be between -180 and 180';