diff options
author | ivan <ivan> | 2008-01-13 21:35:54 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-01-13 21:35:54 +0000 |
commit | 0930d22ffc440f80c1b222b2e750cadbabd9e8f6 (patch) | |
tree | 59d6738ed4c685cd9bec804e9d3f661f4f37d72c /httemplate/edit/process/svc_broadband.cgi | |
parent | f49f11d4c3c4ba9480cc5c9acfaa606a5ba73ad1 (diff) |
ACLs
Diffstat (limited to 'httemplate/edit/process/svc_broadband.cgi')
-rw-r--r-- | httemplate/edit/process/svc_broadband.cgi | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/httemplate/edit/process/svc_broadband.cgi b/httemplate/edit/process/svc_broadband.cgi index cf4604639..8600da349 100644 --- a/httemplate/edit/process/svc_broadband.cgi +++ b/httemplate/edit/process/svc_broadband.cgi @@ -1,37 +1,38 @@ -% -% -%$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -%my $svcnum = $1; -% -%my $old; -%if ( $svcnum ) { -% $old = qsearchs('svc_broadband', { 'svcnum' => $svcnum } ) -% or die "fatal: can't find broadband service (svcnum $svcnum)!"; -%} else { -% $old = ''; -%} -% -%my $new = new FS::svc_broadband ( { -% map { -% ($_, scalar($cgi->param($_))); -% } ( fields('svc_broadband'), qw( pkgnum svcpart ) ) -%} ); -% -%my $error; -%if ( $svcnum ) { -% $error = $new->replace($old); -%} else { -% $error = $new->insert; -% $svcnum = $new->svcnum; -%} -% %if ( $error ) { % $cgi->param('error', $error); % $cgi->param('ip_addr', $new->ip_addr); -% print $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string ); +<% $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string ) %> %} else { -% print $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum ); +<% $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum ) %> %} -% -% +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific? + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +my $svcnum = $1; + +my $old; +if ( $svcnum ) { + $old = qsearchs('svc_broadband', { 'svcnum' => $svcnum } ) + or die "fatal: can't find broadband service (svcnum $svcnum)!"; +} else { + $old = ''; +} + +my $new = new FS::svc_broadband ( { + map { + ($_, scalar($cgi->param($_))); + } ( fields('svc_broadband'), qw( pkgnum svcpart ) ) +} ); + +my $error; +if ( $svcnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcnum = $new->svcnum; +} +</%init> |