diff options
Diffstat (limited to 'httemplate/config/config-download.cgi')
| -rw-r--r-- | httemplate/config/config-download.cgi | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/httemplate/config/config-download.cgi b/httemplate/config/config-download.cgi new file mode 100644 index 000000000..c071f2a6d --- /dev/null +++ b/httemplate/config/config-download.cgi @@ -0,0 +1,30 @@ +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $agentnum; +if ($cgi->param('agentnum') =~ /^(\d+)$/) { + $agentnum = $1; +} + +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; +} + +my $locale = ''; +if ($cgi->param('locale') =~ /^(\w+)$/) { + $locale = $1; +} +my $conf=new FS::Conf { 'locale' => $locale }; + +http_header('Content-Disposition' => "attachment; filename=$name" ); +print $conf->config_binary($name, $agentnum); +</%init> |
