summaryrefslogtreecommitdiff
path: root/httemplate/search/prepay_credit.html
diff options
context:
space:
mode:
authorivan <ivan>2007-01-30 20:59:14 +0000
committerivan <ivan>2007-01-30 20:59:14 +0000
commit15777da47bab33e8f0021e6dd9aa6b434fa9be30 (patch)
tree83359450ba8dcac02c86bdbd0c85db45a699fc06 /httemplate/search/prepay_credit.html
parent655b4043942c7d361224d283accb4c2a02ef7359 (diff)
its all about control
Diffstat (limited to 'httemplate/search/prepay_credit.html')
-rw-r--r--httemplate/search/prepay_credit.html27
1 files changed, 16 insertions, 11 deletions
diff --git a/httemplate/search/prepay_credit.html b/httemplate/search/prepay_credit.html
index c79acb005..ab6490d33 100644
--- a/httemplate/search/prepay_credit.html
+++ b/httemplate/search/prepay_credit.html
@@ -1,14 +1,3 @@
-%
-%my $agent = '';
-%my $hashref = {};
-%if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
-% $hashref->{agentnum} = $1;
-% $agent = qsearchs('agent', { 'agentnum' => $1 } );
-%}
-%
-%my $count_query = 'SELECT COUNT(*) FROM prepay_credit';
-%$count_query .= ' WHERE agentnum = '. $agent->agentnum if $agent;
-%
<% include( 'elements/search.html',
'title' => 'Unused Prepaid Cards'.
($agent ? ' for '. $agent->agent : ''),
@@ -61,3 +50,19 @@
],
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $agent = '';
+my $hashref = {};
+if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
+$hashref->{agentnum} = $1;
+$agent = qsearchs('agent', { 'agentnum' => $1 } );
+}
+
+my $count_query = 'SELECT COUNT(*) FROM prepay_credit';
+$count_query .= ' WHERE agentnum = '. $agent->agentnum if $agent;
+
+</%init>