summaryrefslogtreecommitdiff
path: root/httemplate/config/config-download.cgi
blob: 6979246dbc5c0d65dee58a7acf633e904bd8f742 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
%
%
%my $conf=new FS::Conf;
%
%http_header('Content-Type' => 'application/x-unknown' );
%
%die "No configuration variable specified (bad URL)!" # umm
%  unless $cgi->param('key');
%$cgi->param('key') =~  /^([-\w.]+)$/;
%my $name = $1;
%
%my $agentnum;
%if ($cgi->param('agentnum') =~ /^(\d+)$/) {
%  $agentnum = $1;
%}
%
%http_header('Content-Disposition' => "attachment; filename=$name" );
% print $conf->config_binary($name, $agentnum);
<%init>
die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

my $agentnum;
if ($cgi->param('agentnum') =~ /^(\d+)$/) {
  $agentnum = $1;
}

</%init>