Apache::ASP 2.55 required
[freeside.git] / htetc / global.asa
1 use strict;
2 use vars qw( $cgi $p );
3 use Apache::ASP 2.55;
4 use CGI 2.47;
5 #use CGI::Carp qw(fatalsToBrowser);
6 use Date::Format;
7 use Date::Parse;
8 use Time::Local;
9 use Tie::IxHash;
10 use HTML::Entities;
11 use IO::Handle;
12 use IO::File;
13 use String::Approx qw(amatch);
14 use HTML::Widgets::SelectLayers 0.03;
15 use FS::UID qw(cgisuidsetup dbh getotaker datasrc driver_name);
16 use FS::Record qw(qsearch qsearchs fields dbdef);
17 use FS::Conf;
18 use FS::CGI qw(header menubar popurl table itable ntable idiot eidiot
19                small_custview myexit http_header);
20 use FS::Msgcat qw(gettext geterror);
21 use FS::Misc qw( send_email );
22
23 use FS::agent;
24 use FS::agent_type;
25 use FS::domain_record;
26 use FS::cust_bill;
27 use FS::cust_bill_pay;
28 use FS::cust_credit;
29 use FS::cust_credit_bill;
30 use FS::cust_main;
31 use FS::cust_main_county;
32 use FS::cust_pay;
33 use FS::cust_pkg;
34 use FS::cust_refund;
35 use FS::cust_svc;
36 use FS::nas;
37 use FS::part_bill_event;
38 use FS::part_pkg;
39 use FS::part_referral;
40 use FS::part_svc;
41 use FS::pkg_svc;
42 use FS::port;
43 use FS::queue qw(joblisting);
44 use FS::raddb;
45 use FS::session;
46 use FS::svc_acct;
47 use FS::svc_acct_pop qw(popselector);
48 use FS::svc_acct_sm;
49 use FS::svc_domain;
50 use FS::svc_forward;
51 use FS::svc_www;
52 use FS::type_pkgs;
53 use FS::part_export;
54 use FS::part_export_option;
55 use FS::export_svc;
56 use FS::msgcat;
57
58 sub Script_OnStart {
59   $Response->AddHeader('Pragma' => 'no-cache');
60   $Response->AddHeader('Cache-control' => 'no-cache');
61 #  $Response->AddHeader('Expires' => 0);
62   $Response->{Expires} = -36288000;
63
64   $cgi = new CGI;
65   &cgisuidsetup($cgi);
66   $p = popurl(2);
67   #print $cgi->header( '-expires' => 'now' );
68 }
69
70 sub Script_OnFlush {
71   my $ref = $Response->{BinaryRef};
72   #$$ref = $cgi->header( @FS::CGI::header ) . $$ref;
73   if ( dbh->can('sprintProfile') ) {
74
75     $$ref =~ s/<\/BODY>[\s\n]*<\/HTML>[\s\n]*$//i
76       or warn "can't remove";
77   
78     #$$ref .= '<PRE>'. ("\n"x96). encode_entities(dbh->sprintProfile()). '</PRE>';
79     #  wtf?  konqueror...
80     $$ref .= '<PRE>'. ("\n"x4096). encode_entities(dbh->sprintProfile()). '</PRE>';
81
82     $$ref .= '</BODY></HTML>';
83     
84     dbh->{'private_profile'} = {};
85   }
86 }