optimize CDR rating after timed rate perf regression, RT#15739
[freeside.git] / httemplate / misc / unsusp_pkg.cgi
index 00f3a08..b350693 100755 (executable)
@@ -1,5 +1,12 @@
-<!-- $Id: unsusp_pkg.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
-<%
+%if ( $error ) {
+%  errorpage($error);
+%} else {
+<% $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')) %>
+%}
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Unsuspend customer package');
 
 #untaint pkgnum
 my ($query) = $cgi->keywords;
@@ -9,8 +16,5 @@ my $pkgnum = $1;
 my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
 
 my $error = $cust_pkg->unsuspend;
-&eidiot($error) if $error;
-
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
 
-%>
+</%init>