X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htetc%2Fglobal.asa;h=f00ae57f53751a08a4f20ae9551afdcd755900f8;hp=5b0ac49916da0c8d81a95007038b34128bca4bfa;hb=c8f80bd5aaeb0f3844a7cece4bfe250d4f89f745;hpb=c2a0b1b8e9d437434e326a3b573d7134c5697213 diff --git a/htetc/global.asa b/htetc/global.asa index 5b0ac4991..f00ae57f5 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -9,6 +9,7 @@ use CGI; use Date::Format; use Date::Parse; use Time::Local; +use File::Basename; use Tie::IxHash; use HTML::Entities; use IO::Handle; @@ -195,5 +196,36 @@ sub include { $Response->Include(@_); } +if ( defined(@DBIx::Profile::ISA) ) { + + #false laziness w/above + *redirect = sub { + my($location) = @_; + + ${$Response->{BinaryRef}} = + $cgi->header. + qq!Redirect to $location!. + '

'.
+        ( UNIVERSAL::can(dbh, 'sprintProfile')
+            ? encode_entities(dbh->sprintProfile())
+            : 'DBIx::Profile missing sprintProfile method;'.
+              'unpatched or too old?'                        ).
+      "\n\n". &sprintAutoProfile().  '
'. + ''; + + dbh->{'private_profile'} = {}; + + $Response->End; + + }; + +} else { + + *redirect = sub { + $Response->Redirect(@_); + } + +} + 1;