summaryrefslogtreecommitdiff
path: root/httemplate/config/config-download.cgi
diff options
context:
space:
mode:
authormark <mark>2011-09-16 00:15:48 +0000
committermark <mark>2011-09-16 00:15:48 +0000
commit9c866ccad0f187f29d21f12b93f15f2787aa9843 (patch)
treef1a17825d748de59b6d578f5510ab2bb9e6a43bb /httemplate/config/config-download.cgi
parent2e9b97a7492a06855cc55a65f4df7b14607a0db9 (diff)
invoice template and config localization, #12367
Diffstat (limited to 'httemplate/config/config-download.cgi')
-rw-r--r--httemplate/config/config-download.cgi38
1 files changed, 20 insertions, 18 deletions
diff --git a/httemplate/config/config-download.cgi b/httemplate/config/config-download.cgi
index 6979246db..c071f2a6d 100644
--- a/httemplate/config/config-download.cgi
+++ b/httemplate/config/config-download.cgi
@@ -1,21 +1,3 @@
-%
-%
-%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');
@@ -25,4 +7,24 @@ 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>