add datestamp to batch name derived from filename, remove temp files for all errors...
[freeside.git] / httemplate / edit / process / invoice_logo.html
1 <%init>
2
3 my $curuser =  $FS::CurrentUser::CurrentUser;
4
5 die "access denied"
6   unless $curuser->access_right('Configuration');
7
8 my $conf = new FS::Conf;
9
10 $cgi->param('type') =~ /^(png|eps)$/ or die "illegal type";
11 my $type = $1;
12
13 $cgi->param('name') =~ /^([^\.\/]*)$/ or die "illegal name";
14 my $tname = my $name = $1;
15 $tname = "_$tname" if length($tname);
16
17 $cgi->param('preview_session') =~ /^(\w*)$/ or die "illegal preview_session";
18 my $session = $1;
19 my $data = decode_base64( $curuser->option("logo_preview$session") );
20
21 $conf->set_binary("logo$name.$type", $data);
22
23 $cgi->redirect(popurl(3). "edit/invoice_logo.html?type=$type;name=$name;msg=Logo%20changed");
24
25 </%init>