summaryrefslogtreecommitdiff
path: root/httemplate/view/image.cgi
diff options
context:
space:
mode:
authorivan <ivan>2010-10-14 01:14:27 +0000
committerivan <ivan>2010-10-14 01:14:27 +0000
commit7bbe939d139be7edd77378cfc9a2c3ec6287749d (patch)
tree4c43f97b729880ae191cc630d9402b843ca76870 /httemplate/view/image.cgi
parentf839709351aee1f9488e9a26496adc564aa5b8e5 (diff)
more contact work and preliminary business card upload
Diffstat (limited to 'httemplate/view/image.cgi')
-rw-r--r--httemplate/view/image.cgi31
1 files changed, 31 insertions, 0 deletions
diff --git a/httemplate/view/image.cgi b/httemplate/view/image.cgi
new file mode 100644
index 000000000..153ec858e
--- /dev/null
+++ b/httemplate/view/image.cgi
@@ -0,0 +1,31 @@
+<% $data %>\
+<%init>
+
+#die "access denied"
+# unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $conf = new FS::Conf;
+
+my $type;
+if ( $cgi->param('type') eq 'png' ) {
+ $type = 'png';
+} elsif ( $cgi->param('type') eq 'eps' ) {
+ $type = 'eps';
+} else {
+ die "unknown image type ". $cgi->param('type');
+}
+
+my $data;
+if ( $cgi->param('prefname') =~ /^(\w+)$/ ) {
+
+ my $prefname = $1;
+ my $curuser = $FS::CurrentUser::CurrentUser;
+ $data = decode_base64( $curuser->option("$prefname") );
+
+} else {
+ die "no preview_session specified";
+}
+
+http_header('Content-Type' => 'image/png' );
+
+</%init>