fix bugs with Pseudo and Duplicate Device delete (causing web crash)
This commit is contained in:
@@ -44,7 +44,7 @@ foreach my $action (@{ setting('job_prio')->{high} },
|
||||
};
|
||||
}
|
||||
|
||||
ajax '/ajax/control/admin/delete' => require_role admin => sub {
|
||||
ajax qr{/ajax/control/admin/(?:\w+/)?delete} => require_role admin => sub {
|
||||
send_error('Missing device', 400) unless param('device');
|
||||
|
||||
my $device = NetAddr::IP->new(param('device'));
|
||||
|
||||
@@ -12,12 +12,6 @@ register_admin_task({
|
||||
label => 'Duplicate Devices',
|
||||
});
|
||||
|
||||
ajax '/ajax/control/admin/duplicatedevices/delete' => require_role admin => sub {
|
||||
my $ip = NetAddr::IP::Lite->new(param('ip'));
|
||||
send_error('Bad Request', 400) unless ($ip and $ip->addr ne '0.0.0.0');
|
||||
forward '/ajax/control/admin/delete', { device => param('ip') };
|
||||
};
|
||||
|
||||
ajax '/ajax/content/admin/duplicatedevices' => require_role admin => sub {
|
||||
my @set = schema('netdisco')->resultset('Device')->search({
|
||||
serial => { '-in' => schema('netdisco')->resultset('Device')->search({
|
||||
|
||||
@@ -54,11 +54,6 @@ ajax '/ajax/control/admin/pseudodevice/add' => require_role admin => sub {
|
||||
});
|
||||
};
|
||||
|
||||
ajax '/ajax/control/admin/pseudodevice/del' => require_role admin => sub {
|
||||
send_error('Bad Request', 400) unless _sanity_ok();
|
||||
forward '/ajax/control/admin/delete', { device => param('ip') };
|
||||
};
|
||||
|
||||
ajax '/ajax/control/admin/pseudodevice/update' => require_role admin => sub {
|
||||
send_error('Bad Request', 400) unless _sanity_ok();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user