fix 'Can't call method "setup" on an undefined value' error when using into rates...
[freeside.git] / httemplate / misc / delete-dsl_device.html
1 % if ( $error ) {
2 %   errorpage($error);
3 % } else {
4 <% $cgi->redirect($p. "view/svc_dsl.cgi?". $svcnum) %>
5 % }
6 <%init>
7
8 # :/  needs agent-virt so you can't futz with arbitrary devices
9
10 die "access denied"
11   unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
12
13 #untaint devicenum
14 my($query) = $cgi->keywords;
15 $query =~ /^(\d+)$/ || die "Illegal devicenum";
16 my $devicenum = $1;
17
18 my $dsl_device = qsearchs('dsl_device', { 'devicenum' => $devicenum } );
19 my $svcnum = $dsl_device->svcnum;
20
21 my $error = $dsl_device->delete;
22
23 </%init>