Ignore entries in the discover form that dont look like IP/hostname
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
* Fix for node search on some formats of IPv6 addr being seen as MAC
|
* Fix for node search on some formats of IPv6 addr being seen as MAC
|
||||||
|
* [#190] Ignore entries in the discover form that don't look like IP/hostname
|
||||||
|
|
||||||
2.029014 - 2014-11-19
|
2.029014 - 2014-11-19
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ sub add_job {
|
|||||||
|
|
||||||
if ($device) {
|
if ($device) {
|
||||||
$device = NetAddr::IP::Lite->new($device);
|
$device = NetAddr::IP::Lite->new($device);
|
||||||
return send_error('Bad device', 400)
|
return if ! $device or $device->addr eq '0.0.0.0';
|
||||||
if ! $device or $device->addr eq '0.0.0.0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jq_insert({
|
jq_insert({
|
||||||
@@ -23,18 +22,22 @@ sub add_job {
|
|||||||
username => session('logged_in_user'),
|
username => session('logged_in_user'),
|
||||||
userip => request->remote_address,
|
userip => request->remote_address,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
true;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $action (@{ setting('job_prio')->{high} },
|
foreach my $action (@{ setting('job_prio')->{high} },
|
||||||
@{ setting('job_prio')->{normal} }) {
|
@{ setting('job_prio')->{normal} }) {
|
||||||
|
|
||||||
ajax "/ajax/control/admin/$action" => require_role admin => sub {
|
ajax "/ajax/control/admin/$action" => require_role admin => sub {
|
||||||
add_job($action, param('device'), param('extra'));
|
add_job($action, param('device'), param('extra'))
|
||||||
|
or send_error('Bad device', 400);
|
||||||
};
|
};
|
||||||
|
|
||||||
post "/admin/$action" => require_role admin => sub {
|
post "/admin/$action" => require_role admin => sub {
|
||||||
add_job($action, param('device'), param('extra'));
|
add_job($action, param('device'), param('extra'))
|
||||||
redirect uri_for('/admin/jobqueue')->path;
|
? redirect uri_for('/admin/jobqueue')->path
|
||||||
|
: redirect uri_for('/')->path;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user