X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fconfig%2Fconfig-download.cgi;h=c071f2a6d208e4e22fac246a957b0e7749cd0e56;hp=95a172a516ea0d4563c5beb20604f8daab750fe0;hb=c3da5cf1caa244937d280e0f406927103beef148;hpb=27216c115fc2a2f8b76abc91be9bba599c6516fc diff --git a/httemplate/config/config-download.cgi b/httemplate/config/config-download.cgi index 95a172a51..c071f2a6d 100644 --- a/httemplate/config/config-download.cgi +++ b/httemplate/config/config-download.cgi @@ -1,18 +1,30 @@ -% -% -%my $conf=new FS::Conf; -% -%http_header('Content-Type' => 'application/x-unknown' ); -% -%die "No configuration variable specified (bad URL)!" # umm -% unless $cgi->keywords; -%my($query) = $cgi->keywords; -%$query =~ /^([\w -\)+-\/@;:?=[\]]+)$/; -%my $name = $1; -% -%http_header('Content-Disposition' => "attachment; filename=$name" ); -% print $conf->config_binary($name); <%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);