blob: 524d325429fd9b3e8e5068fdcdf30411aa3324f1 (
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
|
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
unless $curuser->access_right('Configuration');
my $conf = new FS::Conf;
$cgi->param('type') =~ /^(png|eps)$/ or die "illegal type";
my $type = $1;
$cgi->param('name') =~ /^([^\.\/]*)$/ or die "illegal name";
my $tname = my $name = $1;
$tname = "_$tname" if length($tname);
$cgi->param('preview_session') =~ /^(\w*)$/ or die "illegal preview_session";
my $session = $1;
my $data = decode_base64( $curuser->option("logo_preview$session") );
$conf->set_binary("logo$name.$type", $data);
$cgi->redirect(popurl(3). "edit/invoice_logo.html?type=$type;name=$name;msg=Logo%20changed");
</%init>
|