X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htetc%2Fhandler.pl;h=1660cb3fa354354daa49e04a1f82657e132c600b;hp=8f079af33f2b3e0b876dad6c8760c2c42f9efde8;hb=c8f80bd5aaeb0f3844a7cece4bfe250d4f89f745;hpb=c2a0b1b8e9d437434e326a3b573d7134c5697213 diff --git a/htetc/handler.pl b/htetc/handler.pl index 8f079af33..1660cb3fa 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -67,6 +67,7 @@ sub handler use Date::Format; use Date::Parse; use Time::Local; + use File::Basename; use Tie::IxHash; use HTML::Entities; use IO::Handle; @@ -141,20 +142,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 +159,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');