summaryrefslogtreecommitdiff
path: root/htetc
diff options
context:
space:
mode:
authorivan <ivan>2001-07-30 08:02:51 +0000
committerivan <ivan>2001-07-30 08:02:51 +0000
commit31157731e271ad7c672ec09e756a73304f646b62 (patch)
treeea4c668fbfca16da4ac694957eec28e8f95ffd75 /htetc
parent46b8b49cb4691ef3d3dbe4042550d9ce9f49a156 (diff)
template stuffs
Diffstat (limited to 'htetc')
-rw-r--r--htetc/global.asa20
-rw-r--r--htetc/handler.pl78
2 files changed, 98 insertions, 0 deletions
diff --git a/htetc/global.asa b/htetc/global.asa
new file mode 100644
index 000000000..beb6d02f0
--- /dev/null
+++ b/htetc/global.asa
@@ -0,0 +1,20 @@
+use strict;
+use vars qw( $cgi $p );
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+use FS::UID qw(cgisuidsetup);
+use FS::Record qw(qsearch qsearchs fields);
+use FS::part_svc;
+use FS::CGI qw(header menubar popurl table);
+
+sub Script_OnStart {
+ $cgi = new CGI;
+ &cgisuidsetup($cgi);
+ $p = popurl(2);
+ #print $cgi->header( '-expires' => 'now' );
+}
+
+sub Script_OnFlush {
+ my $ref = $Response->{BinaryRef};
+ $$ref = $cgi->header( '-expires' => 'now' ) .$$ref;
+}
diff --git a/htetc/handler.pl b/htetc/handler.pl
new file mode 100644
index 000000000..145529a06
--- /dev/null
+++ b/htetc/handler.pl
@@ -0,0 +1,78 @@
+#!/usr/bin/perl
+#
+# This is a basic, fairly fuctional Mason handler.pl.
+#
+# For something a little more involved, check out session_handler.pl
+
+package HTML::Mason;
+
+# Bring in main Mason package.
+use HTML::Mason;
+
+# Bring in ApacheHandler, necessary for mod_perl integration.
+# Uncomment the second line (and comment the first) to use
+# Apache::Request instead of CGI.pm to parse arguments.
+use HTML::Mason::ApacheHandler;
+# use HTML::Mason::ApacheHandler (args_method=>'mod_perl');
+
+# Uncomment the next line if you plan to use the Mason previewer.
+#use HTML::Mason::Preview;
+
+use strict;
+
+# List of modules that you want to use from components (see Admin
+# manual for details)
+#{ package HTML::Mason::Commands;
+# use CGI;
+#}
+
+# Create Mason objects
+#
+my $parser = new HTML::Mason::Parser;
+my $interp = new HTML::Mason::Interp (parser=>$parser,
+ comp_root=>'/var/www/masondocs',
+ data_dir=>'/home/ivan/freeside_current/masondata',
+ out_mode=>'stream',
+ );
+my $ah = new HTML::Mason::ApacheHandler (interp=>$interp);
+
+# Activate the following if running httpd as root (the normal case).
+# Resets ownership of all files created by Mason at startup.
+#
+chown (Apache->server->uid, Apache->server->gid, $interp->files_written);
+
+sub handler
+{
+ my ($r) = @_;
+
+ # If you plan to intermix images in the same directory as
+ # components, activate the following to prevent Mason from
+ # evaluating image files as components.
+ #
+ #return -1 if $r->content_type && $r->content_type !~ m|^text/|i;
+
+ #rar
+ { package HTML::Mason::Commands;
+ use strict;
+ use vars qw( $cgi $p );
+ use CGI;
+ #use CGI::Carp qw(fatalsToBrowser);
+ use FS::UID qw(cgisuidsetup);
+ use FS::Record qw(qsearch qsearchs fields);
+ use FS::part_svc;
+ use FS::CGI qw(header menubar popurl table);
+
+ $cgi = new CGI;
+ #&cgisuidsetup($cgi);
+ &cgisuidsetup($r);
+ $p = popurl(2);
+ }
+ $r->content_type('text/html');
+ #eorar
+
+ my $status = $ah->handle_request($r);
+
+ return $status;
+}
+
+1;