allow undiscovered neighbors report to use discover_{waps,phones} setting

This commit is contained in:
Oliver Gorwits
2019-03-03 14:34:00 +00:00
parent ac381e0802
commit 6cdfd80d10
2 changed files with 8 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ get '/ajax/content/admin/undiscoveredneighbors' => require_role admin => sub {
# create a new row object to avoid hitting the DB in get_device()
my $dev = schema('netdisco')->resultset('Device')->new({ip => $r->{remote_ip}});
next unless is_discoverable( $dev, $r->{remote_type} );
next if (not setting('discover_waps')) and $r->{remote_is_wap};
next if (not setting('discover_phones')) and $r->{remote_is_phone};
push @discoverable_results, $r;
}
return unless scalar @discoverable_results;