X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htetc%2Fhandler.pl;h=1479145c0dbd3ca3553ca255e56fab5c254b4a8f;hb=db18a813b59b8254ff19f77770750a781613d79e;hp=d46742544d2a79c35e91ea930af2be9323bbac60;hpb=db4034e2019cb6c7f455640b89e8d5fedeb28932;p=freeside.git diff --git a/htetc/handler.pl b/htetc/handler.pl index d46742544..1479145c0 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -7,7 +7,7 @@ package HTML::Mason; # Bring in main Mason package. -use HTML::Mason 1.1; +use HTML::Mason 1.27; #http://www.masonhq.com/?ApacheModPerl2Redirect # Bring in ApacheHandler, necessary for mod_perl integration. # Uncomment the second line (and comment the first) to use @@ -92,7 +92,9 @@ sub handler use vars qw( %session ); use CGI 2.47 qw(-private_tempfiles); #use CGI::Carp qw(fatalsToBrowser); + use CGI::Cookie; use List::Util qw( max min ); + use Data::Dumper; use Date::Format; use Date::Parse; use Time::Local; @@ -104,9 +106,11 @@ sub handler use URI::Escape; use HTML::Entities; use JSON; + use MIME::Base64; use IO::Handle; use IO::File; use IO::Scalar; + #not actually using this yet anyway...# use IPC::Run3 0.036; use Net::Whois::Raw qw(whois); if ( $] < 5.006 ) { eval "use Net::Whois::Raw 0.32 qw(whois)"; @@ -128,6 +132,7 @@ sub handler use FS::CGI qw(header menubar popurl rooturl table itable ntable idiot eidiot small_custview myexit http_header); use FS::UI::Web qw(svc_url); + use FS::UI::bytecount; use FS::Msgcat qw(gettext geterror); use FS::Misc qw( send_email send_fax states_hash counties state_label ); use FS::Report::Table::Monthly; @@ -149,6 +154,8 @@ sub handler use FS::cust_svc; use FS::nas; use FS::part_bill_event; + use FS::part_event; + use FS::part_event_condition; use FS::part_pkg; use FS::part_referral; use FS::part_svc; @@ -162,6 +169,7 @@ sub handler use FS::session; use FS::svc_acct; use FS::svc_acct_pop qw(popselector); + use FS::acct_rt_transaction; use FS::svc_domain; use FS::svc_forward; use FS::svc_www; @@ -186,6 +194,7 @@ sub handler use FS::inventory_item; use FS::pkg_class; use FS::access_user; + use FS::access_user_pref; use FS::access_group; use FS::access_usergroup; use FS::access_groupagent; @@ -216,7 +225,6 @@ sub handler use RT::Interface::Web; use MIME::Entity; use Text::Wrapper; - use CGI::Cookie; use Time::ParseDate; use HTML::Scrubber; use Text::Quoted; @@ -225,7 +233,14 @@ sub handler } *CGI::redirect = sub { - my( $self, $location ) = @_; + my $self = shift; + my $cookie = ''; + if ( $_[0] eq '-cookie' ) { #this isn't actually used at the moment + (my $x, $cookie) = (shift, shift); + $HTML::Mason::r->err_headers_out->add( 'Set-cookie' => $cookie ); + } + my $location = shift; + use vars qw($m); # false laziness w/below @@ -332,7 +347,15 @@ sub handler return -1 if defined( $r->content_type ) && $r->content_type !~ m!(^text/|\bxml\b)!io; } else { - $ah->interp->set_escape( 'h' => sub { ${$_[0]}; } ); + #$ah->interp->set_escape( 'h' => sub { ${$_[0]}; } ); + $ah->interp->set_escape( 'h' => sub {} ); + + $ah->interp->set_escape( 'js_string' => sub { + #${$_[0]} =~ s/(['\\\n])/'\\'.($1 eq "\n" ? 'n' : $1)/ge; + ${$_[0]} =~ s/(['\\])/\\$1/g; + ${$_[0]} =~ s/\n/\\n/g; + ${$_[0]} = "'". ${$_[0]}. "'"; + } ); } $ah->interp->ignore_warnings_expr('.');