ee17683a62b10c542ba4ba890feb40eede0a032e
[freeside.git] / fs_selfservice / FS-SelfService / cgi / image.cgi
1 #!/usr/bin/perl -T
2 #!/usr/bin/perl -Tw
3
4 use strict;
5 use CGI;
6 use FS::SelfService qw( skin_info );
7
8 my $cgi = new CGI;
9
10 my($query) = $cgi->keywords;
11 my( $name, $agentnum ) = ( '', '' );
12 if ( $query =~ /^(\w+)$/ ) {
13   $name = $1;
14 } else {
15   $cgi->param('name') =~ /^(\w+)$/ or '' =~ /^()$/;
16   $name = $1;
17   if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
18     $agentnum = $1;
19   }
20 }
21
22 my $info = skin_info( agentnum=>$agentnum );
23
24 print $cgi->header( '-type'    => 'image/png', #for now
25                     #'-expires' => 'now',
26                   ).
27       $info->{$name};
28