created a fastcgi compatible version of fmail.pl
authorAdrian Oldham <adriann@visualthought.com.au>
Sun, 8 Feb 2009 04:07:18 +0000 (04:07 +0000)
committeradriann <adriann@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Sun, 8 Feb 2009 04:07:18 +0000 (04:07 +0000)
site/cgi-bin/fmail.fcgi [new file with mode: 0755]

diff --git a/site/cgi-bin/fmail.fcgi b/site/cgi-bin/fmail.fcgi
new file mode 100755 (executable)
index 0000000..fd9ddcd
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+# -d:ptkdb
+BEGIN { $ENV{DISPLAY} = '192.168.32.51:0.0' }
+use strict;
+use FindBin;
+use CGI::Fast;
+use lib "$FindBin::Bin/modules";
+use BSE::DB;
+use BSE::Request;
+use BSE::Template;
+use Carp 'confess';
+use BSE::UI::Formmail;
+
+my $cfg = BSE::Cfg->new; # only do this once
+
+$SIG{__DIE__} = sub { confess $@ };
+
+while(my $cgi = CGI::Fast->new) {
+  my $req = BSE::Request->new(cfg=>$cfg, cgi=>$cgi);
+
+  my $result = BSE::UI::Formmail->new->dispatch($req);
+
+  BSE::Template->output_result($req, $result);
+}
\ No newline at end of file