view release on metacpan or search on metacpan
t/lib/Apache/test.pm view on Meta::CPAN
return $net::callback_hooks{PERL_TABLE_API};
}
},
);
for (qw(Apache::Cookie Apache::Request)) {
$really_have{$_} = $really_have{'Apache::Table'};
}
sub have_module {
my $mod = shift;
t/lib/Apache/test.pm view on Meta::CPAN
values are all 1.
=head1 EXAMPLES
No good examples yet. Example submissions are welcome. In the meantime, see
L<http://forum.swarthmore.edu/~ken/modules/Apache-AuthCookie/> , which
I'm retrofitting to use Apache::test.
=head1 TO DO
The MM_test method doesn't try to be very smart, it just writes the
text that seems to work in my configuration. I am morally against
using the 'make' command for installing Perl modules (though of course
I do it anyway), so I haven't looked into this very much. Send bug
reports or better (patches).
I've got lots of code in my Apache::AuthCookie module (etc.) that
assists in actually making the queries of the running server. I plan
to add that to this module, but first I need to compare what's already
here that does the same stuff.
=head1 KUDOS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Keywords.pm view on Meta::CPAN
#
# This library is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
use Apache::Constants qw(:common);
use Apache::Cookie;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
require AutoLoader;
lib/Apache/Keywords.pm view on Meta::CPAN
README
MANIFEST
=head1 PREREQUISITES
You need Apache::Constants and Apache::Cookie to use Apache::Keywords.
=head1 INSTALLATION
tar zxf Apache-Keywords-0.1.tar.gz
perl Makefile.PL
lib/Apache/Keywords.pm view on Meta::CPAN
# profile and re-store it in the cookie
# Get old "keywords" cookie
if (!defined($name) || $name eq "") {
$name = "Keywords";
}
my $cookie = Apache::Cookie->new($r);
$keywords = $cookie->get($name);
# Make profile
$keywords = make_profile($keywords,$new_keywords);
if (defined($expires)) {
$cookie->set(-expires => $expires);
lib/Apache/Keywords.pm view on Meta::CPAN
$path = $self->{PATH};
} elsif ($r) {
$path = $r->dir_config('KeywordsPath');
}
# Get old "keywords" cookie
my $cookie = Apache::Cookie->new($r);
$keywords = $cookie->get($name);
# Make profile
$keywords = make_profile($keywords,$new_keywords);
# Replace the old cookie with a new one
if (!defined($expires) || length($expires) <= 0) {
lib/Apache/Keywords.pm view on Meta::CPAN
# Return the profile in a hash
sub profile {
my ($self,$r) = @_;
my ($keywords,$cookie,@k,@item,$i);
my %ret = ();
my $cookie = Apache::Cookie->new($r);
my $name = $self->name;
if (!defined($name) || $name eq "") {
$name = "Keywords";
}
$cookie = Apache::Cookie->new($r);
$keywords = $cookie->get($name);
@k = split(/\,\s*/,$keywords);
for ($i=0;$i<=$#k;$i++) {
@item = split(/\:\s*/,$k[$i]);
$ret{$item[0]} = $item[1];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/LangPrefCookie.pm view on Meta::CPAN
package Apache::LangPrefCookie;
use strict;
use warnings;
use Apache::Constants qw(OK DECLINED);
use Apache::Request;
use Apache::Cookie;
use Apache::Log ();
our $VERSION = '1.03';
sub handler {
my $r = Apache::Request->new(shift);
my %cookies = Apache::Cookie->new($r)->parse;
my $cookie_name = $r->dir_config('LangPrefCookieName') || 'prefer-language';
my @ua_lang_prefs;
# $r->log->debug("Looking for cookie: \"$cookie_name\"");
$r->header_out( 'Vary',
lib/Apache/LangPrefCookie.pm view on Meta::CPAN
} ( $cookie_pref_lang, @ua_lang_prefs );
$language_ranges =~ s/,\s*$//;
return DECLINED unless length $language_ranges;
$r->header_in( "Accept-Language", $language_ranges );
$r->log->debug(
"Cookie \"$cookie_name\" requested \"$cookie_pref_lang\", set \"Accept-Language: $language_ranges\""
);
}
return OK;
}
lib/Apache/LangPrefCookie.pm view on Meta::CPAN
1;
__END__
=head1 NAME
Apache::LangPrefCookie - implant a language-preference given by
cookie into httpd's representation of the Accept-Language HTTP-header.
=head1 SYNOPSIS
<Location />
PerlInitHandler Apache::LangPrefCookie
</Location>
<Location /foo>
# optionally set a custom cookie-name, default is "prefer-language"
PerlSetVar LangPrefCookieName "foo-pref"
</Location>
=head1 DESCRIPTION
lib/Apache/LangPrefCookie.pm view on Meta::CPAN
This preference is then implanted into httpd's representation of the
C<Accept-Language> header, just as if the client had asked for it as #1
choice. The original preferences are still present, albeit with lowered
q-values. The cookie's name is configurable, as described in the
examples. Setting/modifying/deleting such a cookie is to be handled
separately; F<Apache::LangPrefCookie> just consumes it.
After that, it's up to httpd's mod_negotiation to choose the best
deliverable representation.
=head2 WHY?
lib/Apache/LangPrefCookie.pm view on Meta::CPAN
=head1 EXAMPLE COOKIE
C<prefer-language=x-klingon;expires=Saturday 31-Dec-05 24:00:00 GMT;path=/>
Optionally, the default cookie name C<prefer-language> can be overridden
by setting the C<LangPrefCookieName> variable:
C<PerlSetVar LangPrefCookieName "mypref">
C<mypref=x-klingon;expires=Saturday 31-Dec-05 24:00:00 GMT;path=/>
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
package My::SpreadLogger;
use strict;
use Apache::Logger::Spread;
use My::Cookies;
use vars qw( @ISA);
@ISA = qw(Logger::Spread);
sub handler($$)
Apache::Log::Spread::handler($self, $ar);
}
sub _interpolate_log_string {
my ($self, $logref) = @_;
my $cookie = My::Cookie->new();
$$logref =~ s/%\{([\w-]+)\}cookie/$cookie->{$1} || '-'/ego;
}
=back
view all matches for this distribution
view release on metacpan or search on metacpan
MIMEMapper.pm view on Meta::CPAN
This module is free software. It may be used, redistributed
and/or modified under the same terms as Perl itself.
=head1 HISTORY
This code is derived from the I<Cookbook::MIMEMapper> module,
available as part of "The mod_perl Developer's Cookbook".
For more information, visit http://www.modperlcookbook.org/
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
sub process_playlist {
my $self = shift;
my $r = $self->r;
my (@playlist,$changed);
if (my $cookies = CGI::Cookie->parse($r->header_in('Cookie'))) {
my $playlist = $cookies->{playlist};
@playlist = $playlist->value if $playlist;
if ($playlist[-1] &&
$r->lookup_uri($playlist[-1])->content_type ne 'audio/mpeg') {
$self->{possibly_truncated}++;
return HTTP_NO_CONTENT unless @playlist;
return $self->send_playlist(\@playlist);
}
if ($changed) {
my $c = CGI::Cookie->new(-name => 'playlist',
-value => \@playlist);
tied(%{$r->err_headers_out})->add('Set-Cookie' => $c);
(my $uri = $r->uri) =~ s!playlist\.m3u$!!;
$self->path_escape(\$uri);
$r->err_header_out(Location => $uri);
return REDIRECT;
}
view all matches for this distribution
view release on metacpan or search on metacpan
MP3/Playlist.pm view on Meta::CPAN
my $session = $self->session;
$session->param(playlist=>[]) unless $session->param('playlist');
my $playlist = $session->param('playlist');
$r->err_headers_out->add('Set-Cookie' => CGI::Cookie->new(-name=>'apache_mp3',
-value=>$session->id,
));
$playlist;
}
view all matches for this distribution
view release on metacpan or search on metacpan
## $Id: Motd.pm,v 1.2 2002/11/01 00:39:57 ramirezc Exp $
use strict;
use vars qw($VERSION);
use Apache;
use Apache::Cookie;
use Apache::Constants qw(:common REDIRECT);
$VERSION = '1.00';
sub handler {
my $r = shift;
my $uri = $r->uri;
my $cn = $r->dir_config('CookieName') || 'seenMOTD';
my $exp = $r->dir_config('ExpireCookie') || '+1d';
my $file = $r->dir_config('MessageFile') || 0;
my $cookieless = $r->dir_config('SupportCookieLess') || 1;
my $port = ($r->server->port eq '80') ? "" : ':'.$r->server->port;
my $tquery = $r->args;
## If the request is the part of the cookie test redirect, then
## take out the ct=1 query_string value and make a note of it
## MessageFile appears to be missing, pass onto next phase
return OK unless $file;
return OK unless -e $file;
## Look for cookie ($cn) and verify it's value
my $cookies = Apache::Cookie->new($r)->parse;
if (my $c = $cookies->{$cn}) {
my $cv = $c->value;
return OK if ($ct_request == 0 && $cv eq '1');
displayMotd($r);
return DONE;
}
## Prepare cookie information and add outgoing headers
my $cookie = Apache::Cookie->new($r,
-name => $cn,-value => '1',-expires => $exp );
$cookie->bake;
## Handle Cookieless clients
if ($cookieless) {
## Apparently this client does not like cookies, pass it on to
## next phase
$r->log_error("Apache::Motd::Bypassed by ".
$r->connection->remote_ip) if $ct_request;
in your httpd.conf
<Directive /path/>
PerlHeaderParserHandler Apache::Motd
PerlSetVar MessageFile /path/to/motd/message
PerlSetVar CookieName CookieName [default: seenMOTD]
PerlSetVar ExpireCookie CookieExpirationTime [default: +1d]
PerlSetVar RedirectInSecs N [default: 10]
PerlSetVar SupportCookieLess (1|0) [default: 1]
=head1 DESCRIPTION
This Apache Perl module provides a web administrator the ability to
configure a webserver with motd (Message of the Day) functionality, just
This sets the wait time (in seconds) before the visitor is redirected to the
initally requested URI
=item B<CookieName> (default: seenMOTD)
Set the name of the cookie name
=item B<ExpireCookie> (default: +1d, 1 day)
Set the expiration time for the cookie
=item B<SupportCookieLess> (default: 1)
This option is set by default to handle clients that do not support
cookies or that have cookies turned off. It performs an external
redirect to the requested C<$uri> along with a C<ct=1> query_string to test
if the client accepts cookies. If the external redirect successfully sets
Future versions will correctly support non-cookie clients via URL munging.
Setting this option to 0 is ideally used for when you are totally certain
that all your visitors will accept cookies. This is usually much faster since
it elminates the external redirect. ***Use with caution. Cookieless clients
will get the motd message and *only* the motd if this option is false.
=back
Example:
<Location />
PerlHeaderParserHandler Apache::Motd
PerlSetVar MessageFile /proj/www/motd.txt
PerlSetVar CookieName TermUsage
PerlSetVar RedirectInSecs 5
</Location>
The example above, sets a server wide message (/proj/www/motd.txt) that
=back
=head1 REQUIREMENTS
L<mod_perl>, L<Apache::Cookie>
=head1 CREDITS
Fixes, Bug Reports, Optimizations and Ideas have been generously provided by:
view all matches for this distribution
view release on metacpan or search on metacpan
NNTPGateway.pm view on Meta::CPAN
use Apache::URI qw();
use Apache::Request qw();
use Apache::Log qw();
#use CGI qw/:standard/;
use CGI::Cookie qw();
# Net::NNTP @ISA Net::Cmd, IO::Socket
use IO::Socket;
use Net::Cmd qw(CMD_REJECT CMD_ERROR);
use Net::NNTP qw();
NNTPGateway.pm view on Meta::CPAN
my $Base = '/';
my $StyleSheet = '';
my $Anonymous_Post_Allowed = 0;
my $Organization = $DEFAULT_ORGANIZATION;
my $Templates_Dir = $DEFAULT_TEMPLATES_DIR;
my $Catchup_Cookie_Name = undef;
my $The_User = '';
# Subs decl --------------------------------------------------------------
NNTPGateway.pm view on Meta::CPAN
my $catchupid = $Args->{last_art};
my $catchupdate = $NNTP->date();
my $newnewsok = $NNTP->newnews( $catchupdate, $The_Newsgroup )?1:0;
# Build the catchup cookie
my $cookie = new CGI::Cookie
(
-name => $Catchup_Cookie_Name,
-value => "Id=${catchupid},Date=${catchupdate}",
# 10 years should be enough as expiration date.
-expires => '+10y',
-domain => $COOKIE_DOMAIN,
-path => $Base
);
$r->header_out( 'Set-Cookie' => $cookie );
# Print html header
&print_html_head( $r, 1 );
# Print menu
&print_html_menu( $r );
NNTPGateway.pm view on Meta::CPAN
### Sub get_args() ###
# status = &get_args( request ):
# - Description: Fill in the global hash Args. The args are processed
# in this order: Cookies, path_info, environment variables, GET then
# POST args, each arg overriding previous one if already defined.
# - Arguments : the Apache request
# - Return : 1=ok, 0=failure
###
sub get_args ( $ ) {
NNTPGateway.pm view on Meta::CPAN
# Empty Args...
$Args = {};
# Get cookies vals
my %cookies = CGI::Cookie->parse( $r->header_in('Cookie'));
my $catchupval = $cookies{$Catchup_Cookie_Name}->value() if $cookies{$Catchup_Cookie_Name};
$r->log->notice( "Got cookie $Catchup_Cookie_Name: $catchupval" ) if $DEBUG;
# See action_catchup for settings of cookies
if ( $catchupval =~ /^(Id)=(\d+),\s*(Date)=(\d+)$/ ) {
$Args->{catchup_id} = $2;
$Args->{catchup_date} = $4;
}
NNTPGateway.pm view on Meta::CPAN
}
$The_GroupDescription = $r->dir_config( 'NNTPGatewayGroupDescription' ) || ' ';
$NNTP_Server = $r->dir_config( 'NNTPGatewayNewsServer' ) || $DEFAULT_NEWS_SERVER;
$NewsUrl = "news://${NNTP_Server}/${The_Newsgroup}";
$DEFAULT_ACTION_NAME = $r->dir_config( 'NNTPGatewayDefaultAction' ) || $DEFAULT_ACTION_NAME;
$Catchup_Cookie_Name = 'NNTPGatewayCatchup.' . $The_Newsgroup;
$Organization = $r->dir_config( 'NNTPGatewayOrganization' ) || $Organization;
$Title = $r->dir_config( 'NNTPGatewayTitle' ) || "NNTPGateway: $NewsUrl";
$StyleSheet = $r->dir_config( 'NNTPGatewayStyleSheet' ) || undef;
# Anonymous posts configuration
NNTPGateway.pm view on Meta::CPAN
List articles, all articles from the current newsgroup or only unread
articles if the user/client already did a B<catchup>.
=item catchup
Mark all current articles as read. This use a Cookie.
=item last
Read the last article available from the newsserver.
NNTPGateway.pm view on Meta::CPAN
* Call Net::Cmd functions in a clean manner to make perl 5.6 happy (end of
that Bareword "CMD_ERROR" install bug).
=item v0.8
* Cookie domain better handled for catchup.
* NNTPGatewayNewsGroupTest removed. Set up a new Location and set
NNTPGatewayNewsGroup to the test group and NNTPGatewayDebug on to achieve
the same functionality.
* Some more directives to control users checking
(NNTPGatewayUsersNamesCaseInsensitive, NNTPGatewayNonLocalPostOk).
NNTPGateway.pm view on Meta::CPAN
** CPAN Enabled distrib (Makefile.PL, .tar.gz dist, README file, CPAN ID
...).
=item v0.7
* The configuration directive B<NNTPGatewayCatchupCookieName> do not exists anymore.
* Disconnections to news server start to be better handled.
=item v0.6
First public release
view all matches for this distribution
view release on metacpan or search on metacpan
PAR/PerlRun.pm view on Meta::CPAN
@ISA = qw(Exporter);
$VERSION = '0.30';
unless ($mod_perl::VERSION < 1.99) {
@ISA = qw(Exporter Apache::PAR::RegistryCooker);
require Apache::PAR::RegistryCooker;
require Apache::Const;
import Apache::Const qw(OK);
}
else {
@ISA = qw(Exporter Apache::PAR::ScriptBase Apache::PerlRun);
PAR/PerlRun.pm view on Meta::CPAN
require Apache::PAR::ScriptBase;
require Apache::Constants;
import Apache::Constants qw(OK);
}
my $parent = 'Apache::PAR::RegistryCooker';
my %aliases = (
new => 'new',
init => 'init',
default_handler => 'default_handler',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Template/PSP/Tags.psp view on Meta::CPAN
</perl>
</tag>
<tag name="cookie" global="1" accepts="name,value,expires,path">
<perl>
SetCookie($name, $value, $expires, $path);
</perl>
</tag>
<tag name="ldap" global="1" body="1"
accepts="name,host,port,username,password,timeout,action,base,sort,attributes">
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/PageKit.pm view on Meta::CPAN
use strict;
# CPAN Modules required for pagekit
use Apache::URI ();
use Apache::Cookie ();
use Apache::Request ();
use Apache::SessionX ();
use Apache::Util ();
use Compress::Zlib ();
use File::Find ();
lib/Apache/PageKit.pm view on Meta::CPAN
$pk->{browser_cache} = 'no';
} else {
# display login page with error message
$pk->{page_id} = $config->get_global_attr('login_page');
$model->pkit_gettext_message('Cookies must be enabled in your browser.', is_error => 1);
}
}
my $require_login = $config->get_page_attr($pk->{page_id},'require_login');
if(defined($require_login) && $require_login =~ /^(yes|recent)$/){
lib/Apache/PageKit.pm view on Meta::CPAN
my $pkit_id = 'pkit_id' . ( $config->get_server_attr('cookie_postfix') || '' );
my $cookie_domain_str = $config->get_server_attr('cookie_domain');
my @cookie_domains = defined($cookie_domain_str) ? split(' ',$cookie_domain_str) : (undef);
for my $cookie_domain (@cookie_domains){
my $cookie = Apache::Cookie->new($apr,
-name => $pkit_id,
-value => $ses_key,
-path => "/");
$cookie->domain($cookie_domain) if $cookie_domain;
if ($remember){
lib/Apache/PageKit.pm view on Meta::CPAN
my ($pk) = @_;
my $apr = $pk->{apr};
my $model = $pk->{model};
my %cookies = Apache::Cookie->fetch;
my $cookie_pkit_id = 'pkit_id' . ( $pk->{config}->get_server_attr('cookie_postfix') || '' );
return unless $cookies{$cookie_pkit_id};
my %ticket = $cookies{$cookie_pkit_id}->value;
lib/Apache/PageKit.pm view on Meta::CPAN
sub logout {
my ($pk) = @_;
my $config = $pk->{config};
my %cookies = Apache::Cookie->fetch;
my $cookie_postfix = $config->get_server_attr('cookie_postfix') || '';
my $pkit_id = 'pkit_id' . $cookie_postfix;
my $pkit_session_id = 'pkit_session_id' . $cookie_postfix;
lib/Apache/PageKit.pm view on Meta::CPAN
}
my $apr = $pk->{apr};
my $config = $pk->{config};
my %cookies = Apache::Cookie->fetch;
my $pkit_session_id = 'pkit_session_id' . ( $config->get_server_attr('cookie_postfix') || '' );
my $session_id;
lib/Apache/PageKit.pm view on Meta::CPAN
# unset cookie for old session
my $cookie_domain_str = $pk->{config}->get_server_attr('cookie_domain');
my @cookie_domains = defined($cookie_domain_str) ? split(' ',$cookie_domain_str) : (undef);
for my $cookie_domain (@cookie_domains){
my $cookie = Apache::Cookie->new($apr,
-name => $pkit_session_id,
-value => "",
-path => "/");
$cookie->domain($cookie_domain) if $cookie_domain;
$cookie->expires('-5y');
lib/Apache/PageKit.pm view on Meta::CPAN
my $pkit_session_id = 'pkit_session_id' . ( $pk->{config}->get_server_attr('cookie_postfix') || '' );
my $expires = $pk->{config}->get_global_attr('session_expires');
my $cookie_domain_str = $pk->{config}->get_server_attr('cookie_domain');
my @cookie_domains = defined($cookie_domain_str) ? split(' ',$cookie_domain_str) : (undef);
for my $cookie_domain (@cookie_domains){
my $cookie = Apache::Cookie->new($apr,
-name => $pkit_session_id,
-value => $session_id,
-path => "/");
$cookie->domain($cookie_domain) if $cookie_domain;
$cookie->expires($expires) if $expires;
lib/Apache/PageKit.pm view on Meta::CPAN
Russell D. Weiss
Paul Flinders
Bill Karwin
Daniel Gardner
Andy Massey
Michael Cook
Michael Pheasant
John Moose
Sheldon Hearn
Vladimir Sekissov
Tomasz Konefal
view all matches for this distribution
view release on metacpan or search on metacpan
ParseFormData.pm view on Meta::CPAN
join("=", "path", $args->{'path'}),
);
push(@a, join("=", "expires", &cookie_expire($args->{'expires'}))) if($args->{'expires'});
push(@a, join("=", "secure", $args->{'secure'})) if($args->{'secure'});
push(@a, join("=", "domain", $args->{'domain'})) if($args->{'domain'});
$self->headers_out->{'Set-Cookie'} = join(";", @a);
$self->param($args->{'name'} => $args->{'value'});
return();
}
sub cookie_expire {
view all matches for this distribution
view release on metacpan or search on metacpan
ParseLog.pm view on Meta::CPAN
cc:Cocos (Keeling) Islands
cf:Central African Republic
cg:Congo
ch:Switzerland
ci:Cote D'Ivoire (Ivory Coast)
ck:Cook Islands
cl:Chile
cm:Cameroon
cn:China
co:Colombia
cr:Costa Rica
view all matches for this distribution
view release on metacpan or search on metacpan
ProxyRewrite.pm view on Meta::CPAN
# feed reponse back into our request_record
$response->scan(sub {
my ($header, $value) = @_;
$r->log->debug("respond: OUT $header: $value");
if ($header =~ /^Set-Cookie/i) {
$value =~ /path=([^;]+)/i;
my $cookie_path = $1;
&rewrite_url($r, $remote_site, \$cookie_path, $mapref);
# Handle the special case of when the value
# begins with a port
view all matches for this distribution
view release on metacpan or search on metacpan
Recorder.pm view on Meta::CPAN
$VERSION = '0.07';
use Apache::Constants qw(:common);
#use Apache::File;
use CGI::Cookie;
use Apache::URI;
sub handler {
my $r = shift;
my $id = get_id( $r );
Recorder.pm view on Meta::CPAN
}
sub get_id {
my $r = shift;
my %cookies = CGI::Cookie->parse( $r->header_in( 'Cookie' ) );
if (exists( $cookies{ 'HTTPRecorderID' } ) ) {
return $cookies{ 'HTTPRecorderID' }->value;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
RequestNotes.pm view on Meta::CPAN
#---------------------------------------------------------------------
use 5.004;
use mod_perl 1.21;
use Apache::Constants qw( OK );
use Apache::Cookie;
use Apache::Log;
use Apache::Request;
use strict;
$Apache::RequestNotes::VERSION = '0.06';
RequestNotes.pm view on Meta::CPAN
#---------------------------------------------------------------------
# grab the cookies
#---------------------------------------------------------------------
my %cookiejar = Apache::Cookie->new($r)->parse;
foreach (sort keys %cookiejar) {
my $cookie = $cookiejar{$_};
$cookies{$cookie->name} = $cookie->value;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/ReverseProxy.pm view on Meta::CPAN
# /french/news/index?a=b -> http://www.news.com/index?language=french&a=b
=head1 TO-DO
1. Cookie header translation.
2. Verbose/debug logging.
=head1 REQUIREMENTS
This module requires LWP, available at:
view all matches for this distribution
view release on metacpan or search on metacpan
RewritingProxy.pm view on Meta::CPAN
use strict;
use Apache::Constants qw(:common);
use vars '$req';
use vars '$res';
use vars '$proxiedCookieJar';
use vars '$replayCookies';
use vars '$serverCookies';
use vars '$jar';
use vars '$textHandlerSub';
use vars qw($VERSION @ISA @EXPORT);
$|=1;
RewritingProxy.pm view on Meta::CPAN
# and rewrite them to be absolute links passing through this module
# again.
use Apache::Util qw(:all);
use LWP::UserAgent;
use HTML::TokeParser;
use HTTP::Cookies;
use CGI;
my $r = shift;
my $url = shift;
my $ua = new LWP::UserAgent;
# As we form the request to go to the remote server,
RewritingProxy.pm view on Meta::CPAN
# in the request after yanking out our own URL from
# the cookies.
# Fetch a cookie named RewritingProxy from the client.
my $cookieKey;
my $clientCookies = $r->header_in('Cookie');
my @clientCookiePairs = split (/; /, $clientCookies);
my $thisClientCookiePair;
foreach $thisClientCookiePair (@clientCookiePairs)
{
my ($name,$value) = split (/=/, $thisClientCookiePair);
$cookieKey = $value if ($name eq "RewritingProxyCookieJar");
}
# Set the cookie to be the client's current IP (doesn' really matter).
# Set the cookie to expire in 6 months.
# TODO: Make this thing refresh if a client keeps using the proxy.
if (!$cookieKey)
{
$cookieKey = $r->get_remote_host();
my $cookieString = "RewritingProxyCookieJar=$cookieKey; expires=".
ht_time(time+518400). "; path=/; domain=".$r->get_server_name;
$r->header_out('Set-Cookie'=>$cookieString);
}
# We now need to open the User's cookie jar and see if any cookies
# need to be sent to this particular server.
$jar = "$Apache::RewritingProxy::cacheRoot/cookies/$cookieKey";
$serverCookies = HTTP::Cookies->new(
File => "$jar",
ignore_discard=>1,
AutoSave=>1);
# Load the cookies into memory...
$serverCookies->load() if (-e $jar);
# Let's take care of Referer also.
my $referer = $r->header_in('Referer');
my $script_name = $r->location;
$referer =~ s/(.*$script_name\/)//i;
RewritingProxy.pm view on Meta::CPAN
if ($r->method eq 'GET')
{
$req = new HTTP::Request 'GET' => "$rurl";
$req->header('Referer'=>"$referer");
$serverCookies->add_cookie_header($req);
# This needs to be a simple request or else the redirects will
# not work very nicely. LWP is too smart sometimes.
$res = $ua->simple_request($req);
}
elsif ($r->method eq 'POST')
RewritingProxy.pm view on Meta::CPAN
use URI::URL;
my %FORM;
$req = new HTTP::Request 'POST' => "$rurl";
$req->header('Referer'=>"$referer");
$req->content_type('application/x-www-form-urlencoded');
$serverCookies->add_cookie_header($req);
# $req->content('$buffer');
my $pair;
my @pairs = split (/&/, $r->content);
# TODO: This next bit more efficiently.
# It works for the occasional cgi, but not for constant
RewritingProxy.pm view on Meta::CPAN
{sleep(1);}
open (LOCK, ">$Apache::RewritingProxy::cacheRoot/cookies/$cookieKey.lock");
print LOCK " ";
close LOCK;
# New cookies sent by the server...
my $responseCookies = HTTP::Cookies->new;
$responseCookies->extract_cookies($res);
$responseCookies->scan(\&storeCookies);
# Store the old plus the new...
# $proxiedCookieJar->save();
unlink ("$Apache::RewritingProxy::cacheRoot/cookies/$cookieKey.lock");
sub storeCookies
{
my $version = shift;
my $key = shift;
my $val = shift;
my $path = shift;
RewritingProxy.pm view on Meta::CPAN
# if (!$expires )
# {
# $expires = ht_time(time+3600, '%Y-%m-%d %H:%M:%S',0);
# }
my $proxiedCookieJar = HTTP::Cookies->new(
File => "$jar",
ignore_discard=>1,
AutoSave=>1);
$proxiedCookieJar->load();
$proxiedCookieJar->set_cookie($version,$key,$val,$path,
$domain,$port,$path_spec,$secure,$expires);
$proxiedCookieJar->save();
}
if ($res->code =~ /^3/)
{
# This means it was a server redirect.
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Apache/test.pm view on Meta::CPAN
return $net::callback_hooks{PERL_TABLE_API};
}
},
);
for (qw(Apache::Cookie Apache::Request)) {
$really_have{$_} = $really_have{'Apache::Table'};
}
sub have_module {
my $mod = shift;
t/lib/Apache/test.pm view on Meta::CPAN
values are all 1.
=head1 EXAMPLES
No good examples yet. Example submissions are welcome. In the meantime, see
L<http://forum.swarthmore.edu/~ken/modules/Apache-AuthCookie/> , which
I'm retrofitting to use Apache::test.
=head1 TO DO
The MM_test method doesn't try to be very smart, it just writes the
text that seems to work in my configuration. I am morally against
using the 'make' command for installing Perl modules (though of course
I do it anyway), so I haven't looked into this very much. Send bug
reports or better (patches).
I've got lots of code in my Apache::AuthCookie module (etc.) that
assists in actually making the queries of the running server. I plan
to add that to this module, but first I need to compare what's already
here that does the same stuff.
=head1 KUDOS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/SWIT/Maker.pm view on Meta::CPAN
RewriteRule ^/\$ $rl/index/r [R]
Alias $rl/www \@ServerRoot\@/public_html
Alias /html-tested-javascript /usr/local/share/libhtml-tested-javascript-perl
# Format is:
# Remote IP, time, request, status, duration, referer, user agent
# PID, Cookie, total bytes in request, total bytes in response
LogFormat "%a %t \\"%r\\" %>s %D \\"%{Referer}i\\" \\"%{User-Agent}i\\" %P %{$an}C %I %O" switlog
ENDM
}
sub add_test {
lib/Apache/SWIT/Maker.pm view on Meta::CPAN
<IfModule !mod_deflate.c>
LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
</IfModule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/javascript application/xhtml+xml image/svg+xml
PerlModule Apache2::Request Apache2::Cookie Apache2::Upload Apache2::SubRequest
ENDS
}
sub regenerate_httpd_conf {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/SdnFw.pm view on Meta::CPAN
$options{uri} = $r->uri();
$options{args} = $r->args();
$options{remote_addr} = $r->get_remote_host();
my %headers = $r->headers_in();
if ($headers{Cookie}) {
foreach my $kv (split '; ', $headers{Cookie}) {
my ($k,$v) = split '=', $kv;
$options{cookies}{$k} = $v;
}
}
$options{server_name} = $headers{Host};
lib/Apache/SdnFw.pm view on Meta::CPAN
return error($r,"Unknown return_code: $s->{r}{return_code}");
}
# add cookies
foreach my $cookie (@{$s->{r}{set_cookie}}) {
$r->err_headers_out->add('Set-Cookie' => $cookie);
}
#return error($r,"Missing content_type") unless($s->{r}{content_type});
# compress the data?
view all matches for this distribution
view release on metacpan or search on metacpan
};
}
if ($t > $ts + 60*($idle+$renew)) { # idle timeout
$uri = $self->timeoutURL;
return {
message => "Cookie idle too long '$uid'.",
uri => "$uri?type=idle"
};
}
if ($t > $ts + 60*$renew) { # renew
$uri = $self->renewURL;
=head1 SYNOPSIS
In startup.pl,
$My::obj = Apache::SecSess::Cookie::X509->new(...)
In httpd.conf,
<Location /protected>
PerlAuthenHandler $My::obj->authen
=head1 CLASS HIERARCHY
Below is a diagram of the class hierarchy
SecSess
`+-Cookie
| `+--BasicAuth (for debugging)
| +--LoginForm
| +--X509
| +--X509PIN
| `--URL
`-URL
`---Cookie
SecSess contains (in addition to common code) all Apache phase handlers
(Currently only PerlAuthenHandler are needed). At this level credentials
and status are considered opaque objects. The important methods are:
->renew() Will re-issue credentials if proper conditions are satisfied
->delete() Will delete credentials where relevant (i.e. deletes cookies).
At one level beneath SecSess (SecSess::Cookie.pm and SecSess::URL.pm),
are the methods for interpreting and manipulating credentials.
At the lowest level, are subclasses which "know" how to interpret the
*initial* identifying information during the issuance of credentials.
So, *::Cookie::LoginForm presents the client with a user/password
login form for identification. And thus the difference between
*::Cookie::URL and *::URL::Cookie is that the former will issue cookies
after validating an URL credential, and the latter will "issue" an URL
credential (typically it will redirect to a resource with realm=cred in
the URL) after validating a cookie.
=head1 CREDENTIAL FORMAT
Credentials in Apache::SecSess have a similar format:
URL Credentials (defined in Apache::SecSess::URL):
realm=E_k(md5(hash),hash)
Cookie Credentials: (defined in Apache::SecSess::Cookie):
realm:qop,authqop=E_k(md5(hash),hash)
The string 'realm' is any symbol (without obvious special characters
':', '=', etc) which is used to identify cooperating security services,
thus providing a way to put credentials into their own namespace.
check your assumptions about your local site's openssl with the script
utils/minstren which prints the weakest cipher strength for common
SSLCipherSuite arguments. At my site, I was surprised to find
ALL:!ADH:!EXP:!EXP56 => 56 bits.
=head2 Cookie Domain Argument
cookieDomain => <hashref>
The cookieDomain argument expects a hash reference of the form:
{ 'qop,authqop' => 'domain_string', ... }
where 'domain_string' is literally the HTTP Set-Cookie domain string, and
where the integers 'qop' and 'authqop' serve to define the session and
authentication qualities of protections as described above. A cookie will
be issued with the given domain and of the given strengths for each entry
in this hash. The HTTP Set-Cookie secure flag is set if and only if 'qop'
is nonzero. As a convenient shorthand,
int => 'domain_string'
is equivalent to
'https://noam.acme.org/authen'
]
says that when URL credentials are issued, the client will be redirected
to each of the specified sites, in turn. Each of these is expected to
be protected by a PerlAuthenHandler of type Apache::SecSess::Cookie::URL,
which will issue local cookies.
The argument issueURL is used to tell the remote sites (listed in chainURLS
arg) where to redirect the client back to, in order to continue chaining.
instructions in INSTALL to get it to work. Read db/* for more
info.
=head1 EXAMPLES
=head2 A Simple Cookie Example
Assuming all resources under directory /protected on one or more hosts
in a DNS domain need to be protected, place the following directive
into 'httpd.conf':
On each such host, the secure session object $Acme::obj must be instantiated
from a 'startup.pl' file as in the following example, which uses an X.509
certificate for the original identification and authentication:
use Apache::SecSess::DBI;
use Apache::SecSess::Cookie::X509;
## X.509 certificate authentication, issuing multiple cookies
$Acme::obj = Apache::SecSess::Cookie::X509->new(
dbo => SecSessDBI->new( ... ),
secretFile => 'ckysec.txt',
lifeTime => 1440, idleTime => 60, renewRate => 5,
authRealm => 'Acme',
cookieDomain => {
PerlAuthenHandler $Acme::noam->authen
...
</Location>
where the authen() method is of an object of class
Apache::SecSess::Cookie::URL instantiated as:
$Acme::noam = Apache::SecSess::Cookie::URL->new(
dbo => Apache::SecSess::DBI->new(...),
secretFile => 'ckysec.txt',
lifeTime => 1440, idleTime => 60, renewRate => 5,
minSessQOP => 128, minAuthQOP => 128,
authRealm => 'Acme',
defaultURL => 'https://noam.acme.org/protected',
renewURL => 'https://noam.acme.org/renew',
timeoutURL => 'https://noam.acme.org/signout/timeout.html'
);
Like any other subclass of Apache::SecSess::Cookie, URL.pm will
issue cookies based on the presentation of some identifying information,
and authenURL defines where to go to get that information. The difference
is that it now points to a new DNS domain: stu.transacme.com.
That 'remote login' is protected by
</Location>
i.e., the issue() method of the object $Acme::chain which is instantiated
as
$Acme::chain = Apache::SecSess::URL::Cookie->new(
dbo => Apache::SecSess::DBI->new(...),
secretFile => 'ckysec.txt',
lifeTime => 1440, idleTime => 60, renewRate => 5,
sessQOP => 128, authQOP => 128,
minSessQOP => 128, minAuthQOP => 128,
timeoutURL => 'https://stu.transacme.com/signout/timeout.html'
);
If no cookies are present, the client will be redirected again to
https://stu.transacme.com/authen or the issue() method of a standard
Cookie-based login:
<Location /authen>
PerlAuthenHandler $Acme::stu->issue
...
</Location>
where $Acme::stu is an instance of, say Apache::SecSess::Cookie::X509,
just as in the previous example.
But if and when cookies are present, $Acme::chain->issue will walk
through the URL's listed in the chainURLS argument eventually getting
to https://noam.acme.org/authen protected by
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
my $cookie_class;
if ($MOD_PERL)
{
$cookie_class =
$MOD_PERL == 2 ? 'Apache2::Cookie' : 'Apache::Cookie';
eval "require $cookie_class"
unless $cookie_class->can('new');
}
unless ( $cookie_class && $cookie_class->can('new' ) )
{
require CGI::Cookie;
$cookie_class = 'CGI::Cookie';
}
$self->{cookie_class} = $cookie_class;
if ( $self->{cookie_class} eq 'CGI::Cookie' )
{
$self->{new_cookie_args} = [];
$self->{fetch_cookie_args} = [];
}
else
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
{
my $self = shift;
if ( $MOD_PERL == 2 )
{
my $jar = Apache2::Cookie::Jar->new( @{ $self->{fetch_cookie_args} } );
my $c = $jar->cookies( $self->{cookie_name} );
return $c->value if $c;
}
else
{
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
my $cookie =
$self->{cookie_class}->new
( @{ $self->{new_cookie_args} },
-name => $self->{cookie_name},
# Apache2::Cookie will return undef if we pass undef for
# -value.
-value => ( $self->{session_id} || '' ),
( defined $expires
? ( -expires => $expires )
: ()
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
),
-path => $self->{cookie_path},
-secure => $self->{cookie_secure},
);
# If not running under mod_perl, CGI::Cookie->bake() will call
# print() to send a cookie header right now, which may not be what
# the user wants.
if ( $cookie->can('bake') && ! $cookie->isa('CGI::Cookie') )
{
$cookie->bake( @{ $self->{bake_cookie_args} } );
}
else
{
my $header_object = $self->{header_object};
for my $meth (@HeaderMethods)
{
if ( $header_object->can($meth) )
{
$header_object->$meth->add( 'Set-Cookie' => $cookie );
last;
}
}
}
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
Try this session id first and use it if it exist. If the session does
not exist, it will ignore this parameter and make a new session.
=back
=head2 Cookie-Related Parameters
=over 4
=item * use_cookie => boolean
If true, then this module will use one of C<Apache::Cookie>,
C<Apache2::Cookie> or C<CGI::Cookie> (as appropriate) to set and read
cookies that contain the session id.
=item * cookie_name => name
This is the name of the cookie that this module will set. This
defaults to "Apache-Session-Wrapper-cookie".
Corresponds to the C<Apache::Cookie> "-name" constructor parameter.
=item * cookie_expires => expiration
How long before the cookie expires. This defaults to 1 day, "+1d".
Corresponds to the "-expires" parameter.
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
Corresponds to the C<SemaphoreKey> parameter passed to
C<Apache::Session::Lock::Semaphore>.
=item * mod_usertrack_cookie_name => name
Corresponds to the C<ModUsertrackCookieName> parameter passed to
C<Apache::Session::Generate::ModUsertrack>.
=item * save_path => path
Corresponds to the C<SavePath> parameter passed to
lib/Apache/Session/Wrapper.pm view on Meta::CPAN
=back
=head1 HOW COOKIES ARE HANDLED
When run under mod_perl, this module attempts to first use
C<Apache::Cookie> for cookie-handling. Otherwise it uses
C<CGI::Cookie> as a fallback.
If it ends up using C<CGI::Cookie> then you must provide a
"header_object" parameter. This object must have an
C<err_headers_out()> or C<headers_out()> method. It looks for these
methods in that order. The method is expected to return an object with
an API like C<Apache::Table>. It calls C<add()> on the returned method
to add a "Set-Cookie" header.
=head1 REGISTERING CLASSES
In order to support any C<Apache::Session> subclasses, this module
provides a simple registration mechanism.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Session.pm view on Meta::CPAN
use strict;
#read in the cookie if this is an old session
my $r = Apache->request;
my $cookie = $r->header_in('Cookie');
$cookie =~ s/SESSION_ID=(\w*)/$1/;
#create a session object based on the cookie we got from the browser,
#or a new session if we got no cookie
lib/Apache/Session.pm view on Meta::CPAN
};
#Might be a new session, so lets give them their cookie back
my $session_cookie = "SESSION_ID=$session{_session_id};";
$r->header_out("Set-Cookie" => $session_cookie);
#program continues...
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
SessionManager.pm view on Meta::CPAN
require Apache::Constants;
Apache::Constants->import(qw(DECLINED REDIRECT));
require Apache::URI;
}
# Test libapreq modules
eval { require Apache::Cookie; Apache::Cookie->can('bake'); Apache::Cookie->can('fetch') };
if ($@) {
require CGI::Cookie;
$libapreq = 0;
}
else {
$libapreq = 1;
}
SessionManager.pm view on Meta::CPAN
return (MP2 ? Apache::DECLINED : Apache::Constants::DECLINED) unless $r->is_initial_req;
my $debug_prefix = '[' . $r->connection->remote_ip . "] SessionManager ($$): ";
$session_config{'SessionManagerDebug'} = $r->dir_config('SessionManagerDebug') || 0;
foreach ( qw/SessionManagerURITracking SessionManagerTracking SessionManagerEnableModBackhand
SessionManagerStoreArgs SessionManagerCookieArgs SessionManagerSetEnv SessionManagerExpire
SessionManagerHeaderExclude SessionManagerIPExclude/ ) {
$session_config{$_} = $r->dir_config($_);
}
$r->log_error($debug_prefix . '---START REQUEST: ' . $r->uri . ' ---') if $session_config{'SessionManagerDebug'} > 0;
SessionManager.pm view on Meta::CPAN
# Get session ID from cookie
unless ( $session_config{'SessionManagerURITracking'} eq 'On' ) {
if ( $libapreq ) {
# Test libapreq 1 or 2 version to use correct 'fetch' API
my %cookies = $Apache::Request::VERSION >= 2 ? Apache::Cookie->fetch($r) : Apache::Cookie->fetch;
$session_id = $cookies{$session_config{'SessionManagerName'}}->value if defined $cookies{$session_config{'SessionManagerName'}};
$r->log_error($debug_prefix . 'Apache::Cookie fetch') if $session_config{'SessionManagerDebug'} >= 5;
#print STDERR "$debug_prefix Apache::Cookie fetch\n" if $session_config{'SessionManagerDebug'} >= 5;
}
# Fetch cookies with CGI::Cookie
else {
# At this phase (HeaderParser | Translation), no $ENV{'COOKIE'} var is set, so we use CGI::Cookie parse method by passing 'Cookie' HTTP header
my %cookies = CGI::Cookie->parse($r->headers_in->{'Cookie'});
$session_id = $cookies{$session_config{'SessionManagerName'}}->value if defined $cookies{$session_config{'SessionManagerName'}};
$r->log_error($debug_prefix . 'CGI::Cookie fetch') if $session_config{'SessionManagerDebug'} >= 5;
#print STDERR "$debug_prefix CGI::Cookie fetch\n" if $session_config{'SessionManagerDebug'} >= 5;
}
}
# Prepare Apache::Session::Flex options parameters call
my %apache_session_flex_options = (
SessionManager.pm view on Meta::CPAN
else {
$r->log_error($debug_prefix . 'sending cookie...') if $session_config{'SessionManagerDebug'} > 0;
#print STDERR "$debug_prefix sending cookie...\n" if $session_config{'SessionManagerDebug'} > 0;
# Load cookie specific parameters
foreach my $arg ( split(/\s*,\s*/,$session_config{'SessionManagerCookieArgs'}) ) {
my ($key,$value) = split(/\s*=>\s*/,$arg);
$cookie_options{'-' . lc($key)} = $value if $key =~ /^(expires|domain|path|secure)$/i;
}
# Set default cookie path
$cookie_options{'-path'} = '/' unless $cookie_options{'-path'};
if ( $session_config{'SessionManagerDebug'} >= 5 ) {
$r->log_error($debug_prefix . 'Cookie options:');
#print STDERR "$debug_prefix Cookie options\n";
foreach (sort keys %cookie_options) {
$r->log_error($debug_prefix . ' ' x 8 . "$_ = $cookie_options{$_}");
#print STDERR "\t$_ = $cookie_options{$_}\n";
}
}
# Set cookie with Apache::Cookie
if ( $libapreq ) {
my $cookie = Apache::Cookie->new($r,
name => $session_config{'SessionManagerName'},
value => $session_id,
%cookie_options
);
$cookie->bake;
$r->log_error($debug_prefix . 'Apache::Cookie bake ' . $cookie->as_string) if $session_config{'SessionManagerDebug'} >= 5;
#print STDERR ("$debug_prefix Apache::Cookie bake " . $cookie->as_string . "\n") if $session_config{'SessionManagerDebug'} >= 5;
}
# Set cookie with CGI::Cookie
else {
my $cookie = CGI::Cookie->new(
-name => $session_config{'SessionManagerName'},
-value => $session_id,
%cookie_options
);
$r->err_headers_out->{'Set-Cookie'} = "$cookie";
$r->log_error($debug_prefix . "CGI::Cookie bake $cookie") if $session_config{'SessionManagerDebug'} >= 5;
#print STDERR "$debug_prefix CGI::Cookie bake $cookie\n" if $session_config{'SessionManagerDebug'} >= 5;
}
}
}
$r->log_error($debug_prefix . '---END REQUEST---') if $session_config{'SessionManagerDebug'} > 0;
SessionManager.pm view on Meta::CPAN
=item * mod_perl 1.0 or 2.0 is required (of course) with the appropriate
call-back hooks (PERL_TRANS=1 PERL_HEADER_PARSER=1)
=item * Apache::Session >= 0.53 is required
=item * Apache::Cookie >= 0.33 (libapreq) is preferred but not required
(CGI::Cookie will be used instead)
=item * CGI::Cookie (used only if Apache::Request isn't installed)
=back
Installation as usual:
SessionManager.pm view on Meta::CPAN
PerlSetVar SessionManagerName PSESSID
The default value is C<PERLSESSIONID>
=item C<SessionManagerCookieArgs>
With this directive you can provide optional arguments for cookie attributes
setting. The arguments are passed as comma-separated list of name/value pairs.
The only attributes accepted are:
SessionManager.pm view on Meta::CPAN
=back
For instance:
PerlSetVar SessionManagerCookieArgs "Path => /some-path, \
Domain => .yourdomain.com, \
Secure => 1"
Please see the documentation for L<Apache::Cookie|Apache::Cookie> or
L<CGI::Cookie|CGI::Cookie> in order to see more cookie arguments details.
=item C<SessionManagerStore> datastore
This single directive sets the session datastore used by
L<Apache::Session|Apache::Session> framework
SessionManager.pm view on Meta::CPAN
=head1 SEE ALSO
L<Apache::SessionManager::cookpod|Apache::SessionManager::cookpod>,
L<Apache::Session|Apache::Session>, L<Apache::Session::Flex|Apache::Session::Flex>,
L<Apache::Request|Apache::Request>, L<Apache::Cookie|Apache::Cookie>,
L<CGI::Cookie|CGI::Cookie>, L<Apache|Apache>, perl(1)
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2001-2004 Enrico Sorcinelli. All rights reserved.
This program is free software; you can redistribute it and/or modify it under
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/SiteControl.pm view on Meta::CPAN
use 5.008;
use strict;
use warnings;
use Carp;
use Apache::AuthCookie;
use Apache::Session::File;
our $VERSION = "1.01";
use base qw(Apache::AuthCookie);
our %managers = ();
sub getCurrentUser
{
lib/Apache/SiteControl.pm view on Meta::CPAN
my $r = shift;
my $debug = $r->dir_config("SiteControlDebug") || 0;
my $factory = $r->dir_config("SiteControlUserFactory") || "Apache::SiteControl::UserFactory";
my $auth_type = $r->auth_type;
my $auth_name = $r->auth_name;
my ($ses_key) = ($r->header_in("Cookie") || "") =~ /$auth_type\_$auth_name=([^;]+)/;
$r->log_error("Session cookie: " . ($ses_key ? $ses_key:"UNSET")) if $debug;
$r->log_error("Loading module $factory") if $debug;
eval "require $factory" or $r->log_error("Could not load $factory: $@");
$r->log_error("Using user factory $factory") if $debug;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/StickyQuery.pm view on Meta::CPAN
It is difficult to keep sid query parameter between two cgis without
cookies (or mod_rewrite hacks).
Apache::StickyQuery is a filter that rewrites all links in HTML file
using "sticky query". It would be useful in keeping state (ie. like
Session IDs) without using Cookies. See L<HTML::StickyQuery> for
details.
This module is Filter aware, meaning that it can work within
Apache::Filter framework without modification.
view all matches for this distribution
view release on metacpan or search on metacpan
TaintRequest.pm view on Meta::CPAN
=over 15
=item Note:
This code is derived from the I<Cookbook::TaintRequest> module,
available as part of "The mod_perl Developer's Cookbook".
=back
One of the harder problems facing web developers involves dealing with
potential cross site scripting attacks. Frequently this involves many
TaintRequest.pm view on Meta::CPAN
This module is free software. It may be used, redistributed
and/or modified under the same terms as Perl itself.
=head1 HISTORY
This code is derived from the I<Cookbook::TaintRequest> module,
available as part of "The mod_perl Developer's Cookbook".
For more information, visit http://www.modperlcookbook.org/
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/TestMB.pm view on Meta::CPAN
This is identical to how C<Module::Build> is used. Not all target
systems may have C<Apache::Test> (and therefore C<Apache::TestMB>
installed, so we test for it to be installed, first. But otherwise,
its use can be exactly the same. Consult the
L<Module::Build|Module::Build> documentation for more information on
how to use it; L<Module::Build::Cookbook|Module::Build::Cookbook> may
be especially useful for those looking to migrate from
C<ExtUtils::MakeMaker>.
=head1 INTERFACE
view all matches for this distribution