welcome to the new world
[freeside.git] / httemplate / edit / agent.cgi
index 830862f..11bfc59 100755 (executable)
@@ -1,12 +1,8 @@
 <% include("/elements/header.html","$action Agent", menubar(
-  'Main Menu' => $p,
   'View all agents' => $p. 'browse/agent.cgi',
 )) %>
-% if ( $cgi->param('error') ) { 
-
-<FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
-% } 
 
+<% include('/elements/error.html') %>
 
 <FORM ACTION="<%popurl(1)%>process/agent.cgi" METHOD=POST>
 <INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $agent->agentnum %>">
@@ -80,6 +76,9 @@ Agent #<% $agent->agentnum ? $agent->agentnum : "(NEW)" %>
 
 <%init>
 
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
 my $agent;
 if ( $cgi->param('error') ) {
   $agent = new FS::agent ( {
@@ -97,5 +96,3 @@ my $action = $agent->agentnum ? 'Edit' : 'Add';
 my $conf = new FS::Conf;
 
 </%init>
-
-