X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htetc%2Fhandler.pl;h=0301d98d1582ca03376fa3a4e0f2fd1620528e39;hp=b28cfe9e27d3c76d0f5ce93167e53f62a8321d34;hb=5b27fba78299a534d6d75a7322f26cf6af402b19;hpb=abf5c5442afce5198f6289840791c96f58254e85 diff --git a/htetc/handler.pl b/htetc/handler.pl index b28cfe9e2..0301d98d1 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,13 +73,15 @@ 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; use FS::CGI qw(header menubar popurl table itable ntable idiot eidiot small_custview myexit http_header); use FS::Msgcat qw(gettext geterror); + use FS::Misc qw( send_email ); + use FS::Report::Table::Monthly; use FS::agent; use FS::agent_type; @@ -114,39 +116,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 +161,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');