summaryrefslogtreecommitdiff
path: root/fs_selfservice/FS-SelfService/cgi/image.cgi
blob: ee17683a62b10c542ba4ba890feb40eede0a032e (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
#!/usr/bin/perl -T
#!/usr/bin/perl -Tw

use strict;
use CGI;
use FS::SelfService qw( skin_info );

my $cgi = new CGI;

my($query) = $cgi->keywords;
my( $name, $agentnum ) = ( '', '' );
if ( $query =~ /^(\w+)$/ ) {
  $name = $1;
} else {
  $cgi->param('name') =~ /^(\w+)$/ or '' =~ /^()$/;
  $name = $1;
  if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
    $agentnum = $1;
  }
}

my $info = skin_info( agentnum=>$agentnum );

print $cgi->header( '-type'    => 'image/png', #for now
                    #'-expires' => 'now',
                  ).
      $info->{$name};