summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2010-08-15 00:44:55 +0000
committerivan <ivan>2010-08-15 00:44:55 +0000
commit7515782ca6e453f2e4c9a52c62429e73ce047247 (patch)
tree2f71865e11884fec135ac9fb98d336cb02d9cbe9 /FS
parent7f89738f0f4740efaca00b06034e3a7d86c49ea5 (diff)
address root cause of rt/rt links and remove the workarounds, RT#9280
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Mason.pm20
-rw-r--r--FS/FS/Mason/Request.pm28
2 files changed, 27 insertions, 21 deletions
diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index f5d7c85..7be78aa 100644
--- a/FS/FS/Mason.pm
+++ b/FS/FS/Mason.pm
@@ -453,7 +453,7 @@ sub mason_interps {
RT::LoadConfig();
}
- # A hook supporting strange legacy ways people have added stuff on
+ # A hook supporting strange legacy ways people (well, SG) have added stuff on
my @addl_comp_root = ();
my $addl_comp_root_file = '%%%FREESIDE_CONF%%%/addl_comp_root.pl';
@@ -468,17 +468,20 @@ sub mason_interps {
}
}
+ my $fs_comp_root =
+ scalar(@addl_comp_root)
+ ? [
+ [ 'freeside'=>'%%%FREESIDE_DOCUMENT_ROOT%%%' ],
+ @addl_comp_root,
+ ]
+ : '%%%FREESIDE_DOCUMENT_ROOT%%%';
+
my %interp = (
request_class => $request_class,
data_dir => '%%%MASONDATA%%%',
error_mode => 'output',
error_format => 'html',
ignore_warnings_expr => '.',
- comp_root => [
- [ 'freeside'=>'%%%FREESIDE_DOCUMENT_ROOT%%%' ],
- [ 'rt' =>'%%%FREESIDE_DOCUMENT_ROOT%%%/rt' ],
- @addl_comp_root,
- ],
);
$interp{out_method} = $opt{outbuf} if $mode eq 'standalone' && $opt{outbuf};
@@ -495,6 +498,7 @@ sub mason_interps {
my $fs_interp = new HTML::Mason::Interp (
%interp,
+ comp_root => $fs_comp_root,
escape_flags => { 'js_string' => $js_string_sub,
'defang' => sub {
${$_[0]} = $html_defang->defang(${$_[0]});
@@ -507,6 +511,10 @@ sub mason_interps {
my $rt_interp = new HTML::Mason::Interp (
%interp,
+ comp_root => [
+ [ 'rt' => '%%%FREESIDE_DOCUMENT_ROOT%%%/rt' ],
+ [ 'freeside' => '%%%FREESIDE_DOCUMENT_ROOT%%%' ],
+ ],
escape_flags => { 'h' => \&RT::Interface::Web::EscapeUTF8,
'js_string' => $js_string_sub,
},
diff --git a/FS/FS/Mason/Request.pm b/FS/FS/Mason/Request.pm
index 8d66f4f..95c8027 100644
--- a/FS/FS/Mason/Request.pm
+++ b/FS/FS/Mason/Request.pm
@@ -37,9 +37,19 @@ sub freeside_setup {
my( $filename, $mode ) = @_;
- #warn "initializing for $filename\n";
+ if ( $filename =~ qr(/REST/\d+\.\d+/NoAuth/) ) {
- if ( $filename !~ /\/rt\/.*NoAuth/ ) { #not RT images/JS
+ package HTML::Mason::Commands; #?
+ use FS::UID qw( adminsuidsetup );
+
+ #need to log somebody in for the mail gw
+
+ ##old installs w/fs_selfs or selfserv??
+ #&adminsuidsetup('fs_selfservice');
+
+ &adminsuidsetup('fs_queue');
+
+ } else {
package HTML::Mason::Commands;
use vars qw( $cgi $p $fsurl );
@@ -62,19 +72,7 @@ sub freeside_setup {
die "unknown mode $mode";
}
- } elsif ( $filename =~ /\/rt\/REST\/.*NoAuth/ ) {
-
- package HTML::Mason::Commands; #?
- use FS::UID qw( adminsuidsetup );
-
- #need to log somebody in for the mail gw
-
- ##old installs w/fs_selfs or selfserv??
- #&adminsuidsetup('fs_selfservice');
-
- &adminsuidsetup('fs_queue');
-
- }
+ }
}