diff options
author | root <root@rbsd.ankarstrom.se> | 2021-04-23 18:29:21 +0000 |
---|---|---|
committer | root <root@rbsd.ankarstrom.se> | 2021-04-23 18:29:21 +0000 |
commit | 68373909df410fb1be8c664875e7fa4df2f7e2bc (patch) | |
tree | 1fb8a565cc7718facb550a5d032fa925b357fecc /Inject.pm | |
parent | 2c8e4634e5a3f739fd1e048039893338de63e828 (diff) | |
download | Apache-Inject-68373909df410fb1be8c664875e7fa4df2f7e2bc.tar.gz |
Change directory structure
Diffstat (limited to 'Inject.pm')
-rw-r--r-- | Inject.pm | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/Inject.pm b/Inject.pm deleted file mode 100644 index a9f1a61..0000000 --- a/Inject.pm +++ /dev/null @@ -1,58 +0,0 @@ -package Apache::Inject; - -use strict; -use warnings; - -use Apache2::CmdParms (); -use Apache2::Module (); -use Apache2::Const qw/OR_LIMIT OR_AUTHCFG TAKE12/; - -my @directives = ( - { name => 'Inject', - func => __PACKAGE__.'::Inject', - req_override => OR_LIMIT|OR_AUTHCFG, - args_how => TAKE12, - errmsg => 'Inject HeadFile[!] FootFile[!]' } -); -Apache2::Module::add(__PACKAGE__, \@directives); - -sub Inject { - my ($self, $parms, @args) = @_; - - # Validate arguments and construct corresponding directives - my @vars; - my @names = qw/InjectHead InjectFoot/; - for (@args) { - die 'Arguments to Inject directive cannot contain quotes' if /"/; - push @vars, 'PerlSetVar ' . (shift @names) . ' ' . $_; - } - - # Add relevant directives to current configuration - $parms->add_config(['SetHandler perl-script', - 'PerlResponseHandler Apache::Inject::Handler', - @vars]); -} - -1; -__END__ - -=head1 NAME - -Apache::Inject - Apache directive for injecting HTML headers and footers - -=head1 SYNOPSIS - -DocumentRoot /uar/local/www/apache24/data -PerlModule Apache::Inject -<Directory /usr/local/www/apache24/data> - Inject head.html foot.html -</Directory> - -=head1 DESCRIPTION - -Apache::Inject is a mod_perl module that adds the Inject directive. -It injects a header before the body and (optionally) a footer after the body -of any requested HTML file. - -=cut - |