import rt 3.8.7
[freeside.git] / rt / bin / mason_handler.svc.in
index 3bf851c..d7e68b3 100644 (file)
@@ -2,8 +2,8 @@
 # BEGIN BPS TAGGED BLOCK {{{
 # 
 # COPYRIGHT:
-#  
-# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC 
+# 
+# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
 #                                          <jesse@bestpractical.com>
 # 
 # (Except where explicitly superseded by other copyright notices)
@@ -111,7 +111,7 @@ BEGIN {
        $Win32::TieRegistry::Registry->{
            'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\\'.
            'W3SVC\Parameters\Virtual Roots\\'
-       }->{$RT::WebPath || '/'} = "$path,,205";
+       }->{RT->Config->Get('WebPath') || '/'} = "$path,,205";
            
        $Win32::TieRegistry::Registry->{
            'HKEY_LOCAL_MACHINE\Software\FASTCGI\.html\\'
@@ -225,13 +225,18 @@ warn "Begin listening on $ENV{'FCGI_SOCKET_PATH'}\n";
 require CGI::Fast;
 
 RT::Init();
+$Handler ||= RT::Interface::Web::Handler->new(
+    RT->Config->Get('MasonParameters')
+);
+
 
 # Response loop
 while( my $cgi = CGI::Fast->new ) {
     my $comp = $ENV{'PATH_INFO'};
 
     $comp = $1 if ($comp =~ /^(.*)$/);
-    $comp =~ s|^$RT::WebPath\b||i;
+    my $web_path = RT->Config->Get('WebPath');
+    $comp =~ s|^\Q$web_path\E\b||i;
     $comp .= "index.html" if ($comp =~ /\/$/);
     $comp =~ s/.pl$/.html/g;