template stuffs
authorivan <ivan>
Mon, 30 Jul 2001 08:02:51 +0000 (08:02 +0000)
committerivan <ivan>
Mon, 30 Jul 2001 08:02:51 +0000 (08:02 +0000)
htetc/global.asa [new file with mode: 0644]
htetc/handler.pl [new file with mode: 0644]

diff --git a/htetc/global.asa b/htetc/global.asa
new file mode 100644 (file)
index 0000000..beb6d02
--- /dev/null
@@ -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 (file)
index 0000000..145529a
--- /dev/null
@@ -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;