*finally* seems to be working under Mason. sheesh.
authorivan <ivan>
Sun, 10 Feb 2002 16:05:22 +0000 (16:05 +0000)
committerivan <ivan>
Sun, 10 Feb 2002 16:05:22 +0000 (16:05 +0000)
*finally* seems to be working under Mason.  sheesh.
*finally* seems to be working under Mason.  sheesh.
*finally* seems to be working under Mason.  sheesh.
*finally* seems to be working under Mason.  sheesh.
*finally* seems to be working under Mason.  sheesh.
*finally* seems to be working under Mason.  sheesh.
*finally* seems to be working under Mason.  sheesh.

57 files changed:
htetc/handler.pl
httemplate/browse/agent.cgi
httemplate/browse/agent_type.cgi
httemplate/browse/cust_main_county.cgi
httemplate/browse/cust_pay_batch.cgi
httemplate/browse/nas.cgi
httemplate/browse/part_bill_event.cgi
httemplate/browse/part_pkg.cgi
httemplate/browse/part_referral.cgi
httemplate/browse/part_svc.cgi
httemplate/browse/queue.cgi
httemplate/browse/svc_acct_pop.cgi
httemplate/config/config-process.cgi
httemplate/config/config-view.cgi
httemplate/config/config.cgi
httemplate/edit/REAL_cust_pkg.cgi
httemplate/edit/agent.cgi
httemplate/edit/agent_type.cgi
httemplate/edit/cust_bill_pay.cgi
httemplate/edit/cust_credit.cgi
httemplate/edit/cust_credit_bill.cgi
httemplate/edit/cust_main.cgi
httemplate/edit/cust_main_county-expand.cgi
httemplate/edit/cust_main_county.cgi
httemplate/edit/cust_pay.cgi
httemplate/edit/cust_pkg.cgi
httemplate/edit/part_bill_event.cgi
httemplate/edit/part_pkg.cgi
httemplate/edit/part_referral.cgi
httemplate/edit/part_svc.cgi
httemplate/edit/process/quick-cust_pkg.cgi
httemplate/edit/svc_acct.cgi
httemplate/edit/svc_acct_pop.cgi
httemplate/edit/svc_acct_sm.cgi
httemplate/edit/svc_domain.cgi
httemplate/edit/svc_forward.cgi
httemplate/misc/bill.cgi
httemplate/misc/cancel-unaudited.cgi
httemplate/misc/catchall.cgi
httemplate/misc/delete-customer.cgi
httemplate/misc/link.cgi
httemplate/misc/process/link.cgi
httemplate/search/cust_bill.cgi
httemplate/search/cust_main.cgi
httemplate/search/cust_pay.cgi
httemplate/search/cust_pkg.cgi
httemplate/search/svc_acct.cgi
httemplate/search/svc_acct_sm.cgi
httemplate/search/svc_domain.cgi
httemplate/view/cust_bill.cgi
httemplate/view/cust_main.cgi
httemplate/view/cust_pkg.cgi
httemplate/view/svc_acct.cgi
httemplate/view/svc_acct_sm.cgi
httemplate/view/svc_domain.cgi
httemplate/view/svc_forward.cgi
httemplate/view/svc_www.cgi

index 5544ebb..cac9004 100644 (file)
@@ -34,7 +34,9 @@ my $interp = new HTML::Mason::Interp (parser=>$parser,
                                       data_dir=>'/home/ivan/freeside_current/masondata',
                                       out_mode=>'stream',
                                      );
-my $ah = new HTML::Mason::ApacheHandler (interp=>$interp);
+my $ah = new HTML::Mason::ApacheHandler ( interp => $interp,
+                                          #auto_send_headers => 0,
+                                        );
 
 # Activate the following if running httpd as root (the normal case).
 # Resets ownership of all files created by Mason at startup.
@@ -111,12 +113,12 @@ sub handler
         $r->method('GET');
         $r->headers_in->unset('Content-length');
         $r->content_type('text/html');
-        $r->err_header_out('Location' => $location);
+        #$r->err_header_out('Location' => $location);
+        $r->header_out('Location' => $location);
          $r->header_out('Content-Type' => 'text/html');
          $m->abort(302);
 
         '';
-    
       };
 
       $cgi = new CGI;
@@ -124,6 +126,7 @@ sub handler
       #&cgisuidsetup($r);
       $p = popurl(2);
     }
+
     $r->content_type('text/html');
     #eorar
 
@@ -131,9 +134,12 @@ sub handler
     $headers->{'Pragma'} = $headers->{'Cache-control'} = 'no-cache';
     #$r->no_cache(1);
     $headers->{'Expires'} = '0';
-    
-    $ah->handle_request($r);
 
+#    $r->send_http_header;
+
+    my $status = $ah->handle_request($r);
+
+    $status;
 }
 
 1;
index 8079c72..ebec068 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 #Begin silliness
index ba74e0d..eb20c64 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 print header("Agent Type Listing", menubar(
index 7273dd0..8fbd7fa 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 print header("Tax Rate Listing", menubar(
index 2202967..608a58d 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 print header("Pending credit card batch", menubar(
index f1057ce..9ccbfe6 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 print header('NAS ports', menubar(
index d850ae5..1d674f7 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <% 
 
 my %search;
index 03326d0..0af64e7 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my %search;
index 3ca36b2..76cc226 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 print header("Referral Listing", menubar(
index 5bfb803..4590dc8 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <% 
 
 my %search;
index e38e40b..7fce1f5 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 print header("Job Queue", menubar(
index c6a661a..f3b2966 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 print header('POP Listing', menubar(
index 4b66849..b041ada 100644 (file)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%= header('View Configuration', menubar( 'Main Menu' => $p,
                                      'Edit Configuration' => 'config.cgi' ) ) %>
 
index 56da069..b9e84a8 100644 (file)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%= header('Edit Configuration', menubar( 'Main Menu' => $p ) ) %>
 
 <% my $conf = new FS::Conf; my @config_items = $conf->config_items; %>
index 8ea0e08..abfaac3 100755 (executable)
@@ -1,5 +1,6 @@
+<!-- mason kludge -->
 <%
-# <!-- $Id: REAL_cust_pkg.cgi,v 1.1 2001-10-15 14:58:03 ivan Exp $ -->
+# <!-- $Id: REAL_cust_pkg.cgi,v 1.2 2002-02-10 16:05:22 ivan Exp $ -->
 
 my $error ='';
 my $pkgnum = '';
index 25e4765..3fca343 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $agent;
index 8b72920..4a4cd9a 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my($agent_type);
index bfa2b3b..d906597 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my($paynum, $amount, $invnum);
index 3162265..aae0df2 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 7528d85..1a97e13 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my($crednum, $amount, $invnum);
index a0472bd..41643a3 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
   #for misplaced logic below
index 05bfa6f..66e8aaf 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my($taxnum, $delim, $expansion );
index 1936885..a117117 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 print header("Edit tax rates", menubar(
index 6738dcd..27d36eb 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 7fb88c3..d546f74 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my %pkg = ();
index 25d9bc0..4001643 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) {
index a98179e..d327026 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
index 22277ce..73be9e3 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $part_referral;
index 9199567..63ec1dc 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <% 
    my $part_svc;
    if ( $cgi->param('error') ) { #error
index 5a4fb77..c663dce 100644 (file)
@@ -12,6 +12,9 @@ my @cust_pkg = ();
 my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, );
 
 if ($error) {
+%>
+<!-- mason kludge -->
+<%
   eidiot($error);
 } else {
   print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $cust_pkg[0]->pkgnum );
index fed39e7..73ecdd9 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 97d42f5..5db48a3 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $svc_acct_pop;
index 0cb27b8..0fd5f76 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 671a12d..d20e1f3 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc,
index 88558ca..5f1466b 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 8c21fe1..6f523a5 100755 (executable)
@@ -26,6 +26,9 @@ unless ( $error ) {
 #&eidiot($error) if $error;
 
 if ( $error ) {
+%>
+<!-- mason kludge -->
+<%
   &idiot($error);
 } else {
   print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum");
index a73b2ce..5d3c873 100755 (executable)
@@ -30,15 +30,18 @@ $error = $svc_acct->delete;
 &myeidiot($error) if $error;
 
 $error = $cust_svc->delete;
-&myeidiot($error) if $error;
-
-$dbh->commit or die $dbh->errstr;
-
-print $cgi->redirect(popurl(2));
 
-sub myeidiot {
+if ( $error ) {
   $dbh->rollback;
+  %>
+<!-- mason kludge -->
+<%
   &eidiot(@_);
+} else {
+
+  $dbh->commit or die $dbh->errstr;
+
+  print $cgi->redirect(popurl(2));
 }
 
 %>
index cc4adb8..9aa84be 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 0ed3d01..5088fef 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 81e1bc4..efc762c 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my %link_field = (
index af96c0b..4b220a8 100755 (executable)
@@ -31,6 +31,9 @@ unless ($error) {
   #no errors, so let's view this customer.
   print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?$pkgnum");
 } else {
+%>
+<!-- mason kludge -->
+<%
   idiot($error);
 }
 
index 0c9f27f..d838518 100755 (executable)
@@ -50,8 +50,14 @@ if ( scalar(@cust_bill) == 1 ) {
   my $invnum = $cust_bill[0]->invnum;
   print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum");  #redirect
 } elsif ( scalar(@cust_bill) == 0 ) {
+%>
+<!-- mason kludge -->
+<%
   eidiot("Invoice not found.");
 } else {
+%>
+<!-- mason kludge -->
+<%
   my $total = scalar(@cust_bill);
   print header("Invoice Search Results", menubar(
           'Main Menu', popurl(2)
index 89e325d..b962c7c 100755 (executable)
@@ -152,8 +152,14 @@ if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) {
   }
   #exit;
 } elsif ( scalar(@cust_main) == 0 ) {
+%>
+<!-- mason kludge -->
+<%
   eidiot "No matching customers found!\n";
 } else { 
+%>
+<!-- mason kludge -->
+<%
 
   $total ||= scalar(@cust_main);
   print header("Customer Search Results",menubar(
index 8ebd654..b5bdf82 100755 (executable)
@@ -13,11 +13,17 @@ if (0) {
 #  my $invnum = $cust_bill[0]->invnum;
 #  print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum");  #redirect
 } elsif ( scalar(@cust_pay) == 0 ) {
+%>
+<!-- mason kludge -->
+<%
   idiot("Check # not found.");
   #exit;
 } else {
   my $total = scalar(@cust_pay);
   my $s = $total > 1 ? 's' : '';
+%>
+<!-- mason kludge -->
+<%
   print header("Check # Search Results", menubar(
           'Main Menu', popurl(2)
         )), "$total matching check$s found<BR>", &table(), <<END;
index 6b25fec..54e02ce 100755 (executable)
@@ -77,8 +77,14 @@ if ( scalar(@cust_pkg) == 1 ) {
   print $cgi->redirect(popurl(2). "view/cust_pkg.cgi?$pkgnum");
   #exit;
 } elsif ( scalar(@cust_pkg) == 0 ) { #error
+%>
+<!-- mason kludge -->
+<%
   eidiot("No packages found");
 } else {
+%>
+<!-- mason kludge -->
+<%
   $total ||= scalar(@cust_pkg);
 
   #begin pager
index a3fed83..0918275 100755 (executable)
@@ -63,8 +63,14 @@ if ( scalar(@svc_acct) == 1 ) {
   print $cgi->redirect(popurl(2). "view/svc_acct.cgi?$svcnum");  #redirect
   #exit;
 } elsif ( scalar(@svc_acct) == 0 ) { #error
+%>
+<!-- mason kludge -->
+<%
   idiot("Account not found");
 } else {
+%>
+<!-- mason kludge -->
+<%
   $total ||= scalar(@svc_acct);
 
   #begin pager
index bcfe44c..4ee3006 100755 (executable)
@@ -25,6 +25,9 @@ if ( scalar(@svc_acct_sm) == 1 ) {
   my($svcnum)=$svc_acct_sm[0]->svcnum;
   print $cgi->redirect(popurl(2). "view/svc_acct_sm.cgi?$svcnum");
 } elsif ( scalar(@svc_acct_sm) > 1 ) {
+%>
+<!-- mason kludge -->
+<%
   print header('Mail Alias Search Results'), &table(), <<END;
       <TR>
         <TH>Mail to<BR><FONT SIZE=-1>(click to view mail alias)</FONT></TH>
index 334b6c0..fb372db 100755 (executable)
@@ -35,9 +35,14 @@ if ( scalar(@svc_domain) == 1 ) {
   print $cgi->redirect(popurl(2). "view/svc_domain.cgi?". $svc_domain[0]->svcnum);
   #exit;
 } elsif ( scalar(@svc_domain) == 0 ) {
+%>
+<!-- mason kludge -->
+<%
   eidiot "No matching domains found!\n";
 } else {
-
+%>
+<!-- mason kludge -->
+<%
   my($total)=scalar(@svc_domain);
   print header("Domain Search Results",''), <<END;
 
index da79d79..7c2af06 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 #untaint invnum
index bc76301..90299e4 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 3cf9083..e9670cd 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my %uiview = ();
index 31327a6..90ca1a2 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index ccb81f1..4e5acc4 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index f4aa42b..f302110 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my($query) = $cgi->keywords;
index a5096e9..cafb9e5 100755 (executable)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
index 2fc8ac4..bd8ae36 100644 (file)
@@ -1,3 +1,4 @@
+<!-- mason kludge -->
 <%
 
 my($query) = $cgi->keywords;