3 my $curuser = $FS::CurrentUser::CurrentUser;
6 unless $curuser->access_right('Configuration');
8 my $conf = new FS::Conf;
10 $cgi->param('type') =~ /^(png|eps)$/ or die "illegal type";
13 $cgi->param('name') =~ /^([^\.\/]*)$/ or die "illegal name";
14 my $tname = my $name = $1;
15 $tname = "_$tname" if length($tname);
17 $cgi->param('preview_session') =~ /^(\w*)$/ or die "illegal preview_session";
19 my $data = decode_base64( $curuser->option("logo_preview$session") );
21 $conf->set_binary("logo$name.$type", $data);
23 $cgi->redirect(popurl(3). "edit/invoice_logo.html?type=$type;name=$name;msg=Logo%20changed");