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(@_);
35 my( $filename, $mode ) = @_;
37 #warn "initializing for $filename\n";
39 if ( $filename !~ /\/rt\/.*NoAuth/ ) { #not RT images/JS
41 package HTML::Mason::Commands;
42 use vars qw( $cgi $p $fsurl );
43 use FS::UID qw( cgisuidsetup );
44 use FS::CGI qw( popurl rooturl );
46 if ( $mode eq 'apache' ) {
52 } elsif ( $mode eq 'standalone' ) {
53 $cgi = new CGI $FS::Mason::Request::QUERY_STRING; #better keep setting
56 $fsurl = $FS::Mason::Request::FSURL; #kludgy, but what the hell
57 $p = popurl(2, "$fsurl$filename");
59 die "unknown mode $mode";
62 } elsif ( $filename =~ /\/rt\/REST\/.*NoAuth/ ) {
64 package HTML::Mason::Commands; #?
65 use FS::UID qw( adminsuidsetup );
67 #need to log somebody in for the mail gw
69 ##old installs w/fs_selfs or selfserv??
70 #&adminsuidsetup('fs_selfservice');
72 &adminsuidsetup('fs_queue');