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