X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fbin%2Fmason_handler.fcgi;h=93d1f885548a11662b07b7f445eebc143a750a5e;hp=431eccbd33716a7082d708dd1999e9a09532feb3;hb=289340780927b5bac2c7604d7317c3063c6dd8cc;hpb=945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd diff --git a/rt/bin/mason_handler.fcgi b/rt/bin/mason_handler.fcgi index 431eccbd3..93d1f8855 100755 --- a/rt/bin/mason_handler.fcgi +++ b/rt/bin/mason_handler.fcgi @@ -27,7 +27,7 @@ use strict; use File::Basename; require ('/opt/rt3/bin/webmux.pl'); -my $h = &RT::Interface::Web::NewCGIHandler(); +my $h = &RT::Interface::Web::NewCGIHandler(@RT::MasonParameters); # Enter CGI::Fast mode, which should also work as a vanilla CGI script. require CGI::Fast; @@ -44,11 +44,25 @@ while ( my $cgi = CGI::Fast->new ) { $ENV{'ENV'} = '' if defined $ENV{'ENV'}; $ENV{'IFS'} = '' if defined $ENV{'IFS'}; - unless ($h->interp->comp_exists($cgi->path_info)) { - $cgi->path_info($cgi->path_info . "/index.html"); + RT::ConnectToDatabase(); + + if ( ( !$h->interp->comp_exists( $cgi->path_info ) ) + && ( $h->interp->comp_exists( $cgi->path_info . "/index.html" ) ) ) { + $cgi->path_info( $cgi->path_info . "/index.html" ); + } + + eval { $h->handle_cgi_object($cgi); }; + if ($@) { + $RT::Logger->crit($@); + } + + + if ($RT::Handle->TransactionDepth) { + $RT::Handle->ForceRollback; + $RT::Logger->crit("Transaction not committed. Usually indicates a software fault. Data loss may have occurred") ; } - $h->handle_cgi_object($cgi); - # _should_ always be tied + + } 1;