Do not trigger userlog popups for all/walk jobs
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
* Fix IP Inventory Report to work without daterange
|
* Fix IP Inventory Report to work without daterange
|
||||||
* Fix "list IPs never seen" to work without daterange in IP Inventory Report
|
* Fix "list IPs never seen" to work without daterange in IP Inventory Report
|
||||||
* Correct "Archive" status of nodes in IP Inventory Report
|
* Correct "Archive" status of nodes in IP Inventory Report
|
||||||
|
* Do not trigger userlog popups for all/walk jobs
|
||||||
|
|
||||||
2.023002 - 2014-02-17
|
2.023002 - 2014-02-17
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,20 @@ use Dancer::Plugin::Auth::Extensible;
|
|||||||
|
|
||||||
use Try::Tiny;
|
use Try::Tiny;
|
||||||
|
|
||||||
|
# we have a separate list for jobs needing a device to avoid queueing
|
||||||
|
# such a job when there's no device param (it could still be duff, tho).
|
||||||
|
my %jobs = map { $_ => 1} qw/
|
||||||
|
discover
|
||||||
|
macsuck
|
||||||
|
arpnip
|
||||||
|
/;
|
||||||
|
my %jobs_all = map {$_ => 1} qw/
|
||||||
|
discoverall
|
||||||
|
macwalk
|
||||||
|
arpwalk
|
||||||
|
nbtwalk
|
||||||
|
/;
|
||||||
|
|
||||||
sub add_job {
|
sub add_job {
|
||||||
my ($jobtype, $device, $subaction) = @_;
|
my ($jobtype, $device, $subaction) = @_;
|
||||||
|
|
||||||
@@ -23,26 +37,12 @@ sub add_job {
|
|||||||
action => $jobtype,
|
action => $jobtype,
|
||||||
($subaction ? (subaction => $subaction) : ()),
|
($subaction ? (subaction => $subaction) : ()),
|
||||||
status => 'queued',
|
status => 'queued',
|
||||||
username => session('logged_in_user'),
|
(exists $jobs{$jobtype} ? (username => session('logged_in_user')) : ()),
|
||||||
userip => request->remote_address,
|
userip => request->remote_address,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
# we have a separate list for jobs needing a device to avoid queueing
|
|
||||||
# such a job when there's no device param (it could still be duff, tho).
|
|
||||||
my %jobs = map { $_ => 1} qw/
|
|
||||||
discover
|
|
||||||
macsuck
|
|
||||||
arpnip
|
|
||||||
/;
|
|
||||||
my %jobs_all = map {$_ => 1} qw/
|
|
||||||
discoverall
|
|
||||||
macwalk
|
|
||||||
arpwalk
|
|
||||||
nbtwalk
|
|
||||||
/;
|
|
||||||
|
|
||||||
foreach my $jobtype (keys %jobs_all, keys %jobs) {
|
foreach my $jobtype (keys %jobs_all, keys %jobs) {
|
||||||
ajax "/ajax/control/admin/$jobtype" => require_role admin => sub {
|
ajax "/ajax/control/admin/$jobtype" => require_role admin => sub {
|
||||||
send_error('Missing device', 400)
|
send_error('Missing device', 400)
|
||||||
|
|||||||
Reference in New Issue
Block a user