X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htetc%2Fhandler.pl;h=584d930b11d2c2a46f2ecd5f9da5f1aa2d587f9f;hb=d5005d2e29391ef9f5498626ccec4281f6a850c3;hp=b28cfe9e27d3c76d0f5ce93167e53f62a8321d34;hpb=abf5c5442afce5198f6289840791c96f58254e85;p=freeside.git diff --git a/htetc/handler.pl b/htetc/handler.pl index b28cfe9e2..584d930b1 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; @@ -73,7 +73,7 @@ sub handler use IO::File; use String::Approx qw(amatch); use Chart::LinesPoints; - use HTML::Widgets::SelectLayers 0.02; + use HTML::Widgets::SelectLayers 0.03; use FS::UID qw(cgisuidsetup dbh getotaker datasrc driver_name); use FS::Record qw(qsearch qsearchs fields dbdef); use FS::Conf; @@ -114,39 +114,38 @@ sub handler use FS::router; use FS::addr_block; use FS::svc_broadband; + use FS::svc_external; use FS::type_pkgs; use FS::part_export; use FS::part_export_option; use FS::export_svc; use FS::msgcat; - *notCGI::redirect = sub { + *CGI::redirect = sub { my( $self, $location ) = @_; use vars qw($m); if ( defined(@DBIx::Profile::ISA) ) { #profiling redirect - # my $page = - - - # return $page; + my $page = + 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'} = {}; + return $page; } 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); ''; - } + + } }; @@ -160,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');