4 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
6 # (Except where explictly superceded by other copyright notices)
8 # This work is made available to you under the terms of Version 2 of
9 # the GNU General Public License. A copy of that license should have
10 # been provided with this software, but in any event can be snarfed
13 # This work is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # Unless otherwise specified, all modifications, corrections or
19 # extensions to this work which alter its source code become the
20 # property of Best Practical Solutions, LLC when submitted for
21 # inclusion in the work.
28 require ('@RT_BIN_PATH@/webmux.pl');
30 my $h = &RT::Interface::Web::NewCGIHandler(@RT::MasonParameters);
32 # Enter CGI::Fast mode, which should also work as a vanilla CGI script.
38 while ( my $cgi = CGI::Fast->new ) {
39 # the whole point of fastcgi requires the env to get reset here..
40 # So we must squash it again
41 $ENV{'PATH'} = '/bin:/usr/bin';
42 $ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
43 $ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
44 $ENV{'ENV'} = '' if defined $ENV{'ENV'};
45 $ENV{'IFS'} = '' if defined $ENV{'IFS'};
47 RT::ConnectToDatabase();
49 if ( ( !$h->interp->comp_exists( $cgi->path_info ) )
50 && ( $h->interp->comp_exists( $cgi->path_info . "/index.html" ) ) ) {
51 $cgi->path_info( $cgi->path_info . "/index.html" );
54 eval { $h->handle_cgi_object($cgi); };
56 $RT::Logger->crit($@);
60 if ($RT::Handle->TransactionDepth) {
61 $RT::Handle->ForceRollback;
62 $RT::Logger->crit("Transaction not committed. Usually indicates a software fault. Data loss may have occurred") ;