stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / view / image.cgi
1 <% $data %>\
2 <%init>
3
4 #die "access denied"
5 #  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
6
7 my $conf = new FS::Conf;
8
9 my $type;
10 if ( $cgi->param('type') eq 'png' ) {
11   $type = 'png';
12 } elsif ( $cgi->param('type') eq 'eps' ) {
13   $type = 'eps';
14 } else {
15   die "unknown image type ". $cgi->param('type');
16 }
17
18 my $data;
19 if ( $cgi->param('prefname') =~ /^(\w+)$/ ) {
20
21   my $prefname = $1;
22   my $curuser = $FS::CurrentUser::CurrentUser;
23   $data = decode_base64( $curuser->option("$prefname") );
24
25 } else {
26   die "no preview_session specified";
27 }
28
29 http_header('Content-Type' => 'image/png' );
30
31 </%init>