[freeside-commits] freeside/httemplate/search prepay_credit.html, 1.4, 1.5

Ivan,,, ivan at wavetail.420.am
Tue Jan 30 12:59:16 PST 2007


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv11411/search

Modified Files:
	prepay_credit.html 
Log Message:
its all about control

Index: prepay_credit.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/prepay_credit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- prepay_credit.html	7 Dec 2006 02:40:32 -0000	1.4
+++ prepay_credit.html	30 Jan 2007 20:59:14 -0000	1.5
@@ -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>



More information about the freeside-commits mailing list