1 package FS::Mason::Request;
5 use vars qw( $FSURL $QUERY_STRING );
6 use base 'HTML::Mason::Request';
8 $FSURL = 'http://Set/FS_Mason_Request_FSURL/in_standalone_mode/';
14 my $superclass = $HTML::Mason::ApacheHandler::VERSION ?
15 'HTML::Mason::Request::ApacheHandler' :
16 $HTML::Mason::CGIHandler::VERSION ?
17 'HTML::Mason::Request::CGI' :
18 'HTML::Mason::Request';
20 $class->alter_superclass( $superclass );
22 #huh... shouldn't alter_superclass take care of this for us?
23 __PACKAGE__->valid_params( %{ $superclass->valid_params() } );
26 my $mode = $superclass =~ /Apache/i ? 'apache' : 'standalone';
27 freeside_setup($opt{'comp'}, $mode);
29 $class->SUPER::new(@_);
33 #override alter_superclass ala RT::Interface::Web::Request ??
34 # for Mason 1.39 vs. Perl 5.10.0
38 my( $filename, $mode ) = @_;
40 #warn "initializing for $filename\n";
42 if ( $filename !~ /\/rt\/.*NoAuth/ ) { #not RT images/JS
44 package HTML::Mason::Commands;
45 use vars qw( $cgi $p $fsurl );
46 use FS::UID qw( cgisuidsetup );
47 use FS::CGI qw( popurl rooturl );
49 if ( $mode eq 'apache' ) {
55 } elsif ( $mode eq 'standalone' ) {
56 $cgi = new CGI $FS::Mason::Request::QUERY_STRING; #better keep setting
59 $fsurl = $FS::Mason::Request::FSURL; #kludgy, but what the hell
60 $p = popurl(2, "$fsurl$filename");
62 die "unknown mode $mode";
65 } elsif ( $filename =~ /\/rt\/REST\/.*NoAuth/ ) {
67 package HTML::Mason::Commands; #?
68 use FS::UID qw( adminsuidsetup );
70 #need to log somebody in for the mail gw
72 ##old installs w/fs_selfs or selfserv??
73 #&adminsuidsetup('fs_selfservice');
75 &adminsuidsetup('fs_queue');
82 RT::Interface::Web::Request::callback(@_);
86 RT::Interface::Web::Request::request_path(@_);