add customer status column to customer & most other reports. also put the C in ACL...
[freeside.git] / httemplate / search / reg_code.html
index dc388db..87e0fcd 100644 (file)
@@ -1,13 +1,3 @@
-%
-%
-%my $agentnum = $cgi->param('agentnum');
-%$agentnum =~ /^(\d+)$/ or eidiot "illegal agentnum $agentnum";
-%$agentnum = $1;
-%my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
-%
-%my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum";
-%
-%
 <% include( 'elements/search.html',
                  'title'       => 'Unused Registration Codes for '.
                                   $agent->agent,
                  ],
       )
 %>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $agentnum = $cgi->param('agentnum');
+$agentnum =~ /^(\d+)$/ or eidiot "illegal agentnum $agentnum";
+$agentnum = $1;
+my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
+
+my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum";
+
+<%init>