blob: ad2ff5430937d586e041e487e2c3ebbb7e5d5caa (
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
29
30
31
|
<% $conf->config_binary("logo$templatename.png", $agentnum) %>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('View invoices')
or $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $conf = new FS::Conf;
my $templatename;
my $agentnum = '';
if ( $cgi->param('invnum') ) {
$templatename = $cgi->param('template') || $cgi->param('templatename');
my $cust_bill = qsearchs('cust_bill', { 'invnum' => $cgi->param('invnum') } )
or die 'unknown invnum';
$agentnum = $cust_bill->cust_main->agentnum;
} else {
my($query) = $cgi->keywords;
$query =~ /^([^\.\/]*)$/ or die 'illegal query';
$templatename = $1;
}
if ( $templatename && $conf->exists("logo_$templatename.png") ) {
$templatename = "_$templatename";
} else {
$templatename = '';
}
http_header('Content-Type' => 'image/png' );
</%init>
|