summaryrefslogtreecommitdiff
path: root/httemplate/misc/delete-phone_device.html
blob: 7220c41e3f83ec1a2333635348a26e83a98497ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% if ( $error ) {
%   errorpage($error);
% } else {
<% $cgi->redirect($p. "view/svc_phone.cgi?". $svcnum) %>
% }
<%init>

# :/  needs agent-virt so you can't futz with arbitrary devices

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?

#untaint devicenum
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/ || die "Illegal devicenum";
my $devicenum = $1;

my $phone_device = qsearchs('phone_device', { 'devicenum' => $devicenum } );
my $svcnum = $phone_device->svcnum;

my $error = $phone_device->delete;

</%init>