summaryrefslogtreecommitdiff
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
parent7f89738f0f4740efaca00b06034e3a7d86c49ea5 (diff)
address root cause of rt/rt links and remove the workarounds, RT#9280
-rw-r--r--FS/FS/Mason.pm20
-rw-r--r--FS/FS/Mason/Request.pm28
-rw-r--r--htetc/freeside-rt.conf4
-rw-r--r--htetc/handler.pl9
-rw-r--r--rt/FREESIDE_MODIFIED5
-rwxr-xr-xrt/share/html/Admin/Elements/EditCustomFields4
-rw-r--r--rt/share/html/Elements/ColumnMap7
-rw-r--r--rt/share/html/Elements/RT__CustomField/ColumnMap4
-rw-r--r--rt/share/html/Elements/RefreshHomepage6
-rw-r--r--rt/share/html/Ticket/Graphs/index.html4
10 files changed, 37 insertions, 54 deletions
diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index f5d7c8566..7be78aa03 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 8d66f4fff..95c802796 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');
-
- }
+ }
}
diff --git a/htetc/freeside-rt.conf b/htetc/freeside-rt.conf
index 2753bc6cc..8a6270623 100644
--- a/htetc/freeside-rt.conf
+++ b/htetc/freeside-rt.conf
@@ -1,10 +1,6 @@
<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/rt/NoAuth>
-<Limit GET POST>
-allow from all
-Satisfy any
SetHandler perl-script
PerlHandler HTML::Mason
-</Limit>
</Directory>
<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/rt/REST/1.0/NoAuth>
diff --git a/htetc/handler.pl b/htetc/handler.pl
index 94377cf34..eb9e67ee5 100644
--- a/htetc/handler.pl
+++ b/htetc/handler.pl
@@ -57,16 +57,17 @@ sub handler
if ( $r->filename =~ /\/rt\// ) { #RT
- $ah->interp($rt_interp);
+ # We don't need to handle non-text, non-xml items
+ return -1 if defined( $r->content_type )
+ && $r->content_type !~ m!(^text/|\bxml\b)!io;
+
local $SIG{__WARN__};
local $SIG{__DIE__};
RT::Init();
- # We don't need to handle non-text, non-xml items
- return -1 if defined( $r->content_type )
- && $r->content_type !~ m!(^text/|\bxml\b)!io;
+ $ah->interp($rt_interp);
} else {
diff --git a/rt/FREESIDE_MODIFIED b/rt/FREESIDE_MODIFIED
index ec551c818..50b44ec70 100644
--- a/rt/FREESIDE_MODIFIED
+++ b/rt/FREESIDE_MODIFIED
@@ -18,16 +18,12 @@ lib/RT/Tickets_Overlay.pm #customfield date patch
lib/RT/URI/freeside.pm
lib/RT/URI/freeside/Internal.pm
lib/RT/URI/freeside/XMLRPC.pm
- share/html/Admin/Elements/EditCustomFields
share/html/Admin/Users/Modify.html
- share/html/Elements/ColumnMap
share/html/Elements/CollectionList
share/html/Elements/EditCustomFieldDate #customfield date patch (NEW)
share/html/Elements/Header
share/html/Elements/PageLayout
#html/Elements/QuickCreate
- share/html/Elements/RefreshHomepage
- share/html/Elements/RT__CustomField/ColumnMap
share/html/Elements/RT__Ticket/ColumnMap
share/html/Elements/ShowCustomFieldDate #customfield date patch (NEW)
share/html/Elements/SelectDate
@@ -48,7 +44,6 @@ share/html/Ticket/Elements/ShowMembers_Checklist
share/html/Ticket/Elements/ShowSummary
share/html/Ticket/Elements/ShowTransactionAttachments
share/html/Ticket/Elements/Tabs
- share/html/Ticket/Graph/index.html
share/html/Ticket/ModifyCustomers.html
html/NoAuth/css/3.5-default/main.css
html/NoAuth/css/3.5-default/misc.css
diff --git a/rt/share/html/Admin/Elements/EditCustomFields b/rt/share/html/Admin/Elements/EditCustomFields
index 10f254006..0767e4ae4 100755
--- a/rt/share/html/Admin/Elements/EditCustomFields
+++ b/rt/share/html/Admin/Elements/EditCustomFields
@@ -47,9 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<& /Elements/ListActions, actions => \@results &>
-% my $path = $m->request_comp->path;
-% $path =~ s(^/rt)(); #hacky, dunno why this happens
-<form action="<%RT->Config->Get('WebPath')%><% $path |n %>" method="post" name="EditCustomFields">
+<form action="<%RT->Config->Get('WebPath')%><% $m->request_comp->path |n %>" method="post" name="EditCustomFields">
<input type="hidden" class="hidden" name="id" value="<% $Object->Id || ''%>" />
<input type="hidden" class="hidden" name="ObjectType" value="<% $ObjectType %>" />
<input type="hidden" class="hidden" name="SubType" value="<% $SubType %>" />
diff --git a/rt/share/html/Elements/ColumnMap b/rt/share/html/Elements/ColumnMap
index 6a1c23779..a1475a99d 100644
--- a/rt/share/html/Elements/ColumnMap
+++ b/rt/share/html/Elements/ColumnMap
@@ -157,12 +157,7 @@ my $COLUMN_MAP = {
} qw(WebPath WebBaseURL WebURL)),
WebRequestPath => { value => sub { substr( $m->request_path, 1 ) } },
- #WebRequestPathDir => { value => sub { substr( $m->request_comp->dir_path, 1 ) } },
- WebRequestPathDir => { value => sub {
- my $wrpd = substr( $m->request_comp->dir_path, 1 );
- $wrpd =~ s(^rt/)(); #hacky, dunno why this happens
- $wrpd;
- } },
+ WebRequestPathDir => { value => sub { substr( $m->request_comp->dir_path, 1 ) } },
};
$COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'};
diff --git a/rt/share/html/Elements/RT__CustomField/ColumnMap b/rt/share/html/Elements/RT__CustomField/ColumnMap
index 0a867eb26..6d8d76a4c 100644
--- a/rt/share/html/Elements/RT__CustomField/ColumnMap
+++ b/rt/share/html/Elements/RT__CustomField/ColumnMap
@@ -155,9 +155,7 @@ my $COLUMN_MAP = {
: ($args->{'PassArguments'});
my %pass = map { $_ => $args->{$_} } grep exists $args->{$_}, @pass;
- my $path = $m->request_path;
- $path =~ s(^/rt)(); #hacky, dunno why this happens
- my $uri = RT->Config->Get('WebPath') . $path;
+ my $uri = RT->Config->Get('WebPath') . $m->request_path;
my @res = (
\'<a href="',
diff --git a/rt/share/html/Elements/RefreshHomepage b/rt/share/html/Elements/RefreshHomepage
index 7840f59cc..bf91a9522 100644
--- a/rt/share/html/Elements/RefreshHomepage
+++ b/rt/share/html/Elements/RefreshHomepage
@@ -46,13 +46,9 @@
%#
%# END BPS TAGGED BLOCK }}}
<&|/Widgets/TitleBox, title => loc('Refresh')&>
-<form method="get" action="<% RT->Config->Get('WebPath') . $path %>">
+<form method="get" action="<% RT->Config->Get('WebPath') . $m->request_path %>">
<& /Elements/Refresh, Name => 'HomeRefreshInterval',
Default => $session{'home_refresh_interval'}||RT->Config->Get('HomePageRefreshInterval', $session{'CurrentUser'}) &>
<& /Elements/Submit, Label => loc('Go!') &>
</&>
</form>
-<%init>
-my $path = $m->request_path;
-$path =~ s(^/rt)(); #hacky, dunno why this happens
-</%init>
diff --git a/rt/share/html/Ticket/Graphs/index.html b/rt/share/html/Ticket/Graphs/index.html
index 211d3a0cb..e23737c8e 100644
--- a/rt/share/html/Ticket/Graphs/index.html
+++ b/rt/share/html/Ticket/Graphs/index.html
@@ -56,9 +56,7 @@
<& Elements/ShowGraph, %ARGS, Ticket => $ticket &>
-% my $path = $m->request_comp->path;
-% $path =~ s(^/rt)(); #hacky, dunno why this happens
-<form action="<% RT->Config->Get('WebPath') . $path %>">
+<form action="<% RT->Config->Get('WebPath') . $m->request_comp->path %>">
<input type="hidden" class="hidden" name="id" value="<% $id %>" />
<& Elements/EditGraphProperties, %ARGS, Ticket => $ticket &>