mailgate realiability fix: don't bomb out when FS dbdef hasn't been initialized yet
[freeside.git] / htetc / handler.pl
index 9256435..82a0d7a 100644 (file)
@@ -289,16 +289,23 @@ sub handler
 
       };
       
-      #is this conditional a bad idea entirely, hmm
-      unless ( 
-           $HTML::Mason::r->filename =~ /\/rt\/.*NoAuth/ #RT images/JS
-        && $HTML::Mason::r->filename !~ /\/rt\/REST\//   #but NOT mail gw
-      ) {
+      if ( $HTML::Mason::r->filename !~ /\/rt\/.*NoAuth/ ) { #not RT images/JS
+
         $cgi = new CGI;
         &cgisuidsetup($cgi);
         #&cgisuidsetup($r);
         $p = popurl(2);
         $fsurl = rooturl();
+
+      } elsif ( $HTML::Mason::r->filename =~ /\/rt\/REST\/.*NoAuth/ ) {
+
+        #need to log somebody in for the mail gw
+
+        ##old installs w/fs_selfs or selfserv??
+        #&adminsuidsetup('fs_selfservice');
+
+        &adminsuidsetup('fs_queue');
+
       }
 
       sub include {