X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htetc%2Fhandler.pl;h=ba73bcfafecf4e0488c6fefd01abc94321724524;hb=56c3927f50ecd1ee957a52d76871557bd8813670;hp=8f079af33f2b3e0b876dad6c8760c2c42f9efde8;hpb=69ecd0e15d3de36b56ad133d5ae57dcddc53c63e;p=freeside.git diff --git a/htetc/handler.pl b/htetc/handler.pl index 8f079af33..ba73bcfaf 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -62,7 +62,7 @@ sub handler { package HTML::Mason::Commands; use strict; use vars qw( $cgi $p ); - use CGI; + use CGI 2.47; #use CGI::Carp qw(fatalsToBrowser); use Date::Format; use Date::Parse; @@ -141,20 +141,10 @@ sub handler } else { #normal redirect - #http://www.masonhq.com/docs/faq/#how_do_i_do_an_external_redirect - $m->clear_buffer; - # The next two lines are necessary to stop Apache from re-reading - # POSTed data. - $r->method('GET'); - $r->headers_in->unset('Content-length'); - $r->content_type('text/html'); - #$r->err_header_out('Location' => $location); - $r->header_out('Location' => $location); - $r->header_out('Content-Type' => 'text/html'); - $m->abort(302); - + $m->redirect($location); ''; - } + + } }; @@ -168,6 +158,36 @@ sub handler $m->scomp(@_); } + sub redirect { + my( $location ) = @_; + use vars qw($m); + $m->clear_buffer; + #false laziness w/above + if ( defined(@DBIx::Profile::ISA) ) { #profiling redirect + + $m->print( + qq!Redirect to $location!. + '

'.
+              ( UNIVERSAL::can(dbh, 'sprintProfile')
+                  ? encode_entities(dbh->sprintProfile())
+                  : 'DBIx::Profile missing sprintProfile method;'.
+                    'unpatched or too old?'                        ).
+            #"\n\n". &sprintAutoProfile().  '
'. + "\n\n". ''. + '' + ); + dbh->{'private_profile'} = {}; + + $m->abort(200); + + } else { #normal redirect + + $m->redirect($location); + + } + + } + } # end package HTML::Mason::Commands; $r->content_type('text/html');