view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
PerlSetVar Filter Off
=item CgiHeaders
default 0. When true, script output that looks like HTTP / CGI
headers, will be added to the HTTP headers of the request.
So you could add:
Set-Cookie: test=message
<html>...
# you don't need to use hash notation when you are only setting
# a simple value
$Response->{Cookies}{'Test Name'} = 'Test Value';
I prefer the hash notation for cookies, as this looks nice, and is
quite perlish. It is here to stay. The Cookie() routine is
very complex and does its best to allow access to the
underlying hash structure of the data. This is the best emulation
I could write trying to match the Collections functionality of
cookies in IIS ASP.
off site URL, or string containing the error message.
This extension is useful if you want to have scripts
set error codes with $Response->{Status} like 401
for authentication failure, and to then control from
the script what the error message looks like.
For more information on the Apache ErrorDocument mechanism,
please see ErrorDocument in the CORE Apache settings,
and the Apache->custom_response() API, for which this method
is a wrapper.
=head2 Do not define subroutines in scripts.
DO NOT add subroutine declarations in scripts. Apache::ASP is optimized
by compiling a script into a subroutine for faster future invocation.
Adding a subroutine definition to a script then looks like this to
the compiler:
sub page_script_sub {
...
... some HTML ...
used does not write its state lock file & dbm files to disk, only if
it gets written too like $Session->{MARK}++. Tracking of these NULL $Sessions
then is handled solely in the internal database. For $Session garbage
collection though which would fire Session_OnEnd events and update
SessionCount, the Apache::ASP::State->GroupMembers() function was just
looking for state files on disk ... now it looks in the internal database
too for SessionID records for garbage collection.
Added a test at ./t/session_events.t for these things.
+Some optimizations for $Session API use.
I think the regexp that I was using had O(n^2) characteristics
and it took a really big perl block to 10 +seconds to parse
to understand there was a problem :(
I doubt anyone needed this compatibility, I don't even see
any code that looks like this in the online PerlScript examples,
so I've commented out this parsing trick for now. If you
need me to bring back this functionality, it will be in the
form of a config setting.
For information on PerlScript compatibility, see the PerlScript
-$Request->Form() now reads file uploads correctly with
the latest CGI.pm, where $Request->Form('file_field') returns
the actual file name uploaded, which can be used as a file handle
to read in the data. Before, $Request->Form('file_field') would
return a glob that looks like *Fh::filename, so to get the file
name, you would have to parse it like =~ s/^\*Fh\:\://,
which you no longer have to do. As long as parsing was done as
mentioned, the change should be backwards compatible.
+Updated +enhanced documentation on file uploads. Created extra
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Action.pm view on Meta::CPAN
the object for the duration of the request. See eg/State.pm in this
distribution for an example.
Loaded modules may register actions with Apache::Action using the
'register' call, as described above. When an Apache::Action is 'run',
it looks for the field 'action' in the HTTP request parameters. This
field is of the form "application/module/action". It will then call the
appropriate subref, passing itself as the one and only parameter.
When using this module with HTML::Mason, it is normal to exoprt the
state and the session into the HTML::Mason::Commands namespace so
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/AppSamurai/Tracker.pm view on Meta::CPAN
} else {
die "$session - Must pass in Name value! (No generator functionality supported)";
}
}
# Just make sure it looks non-threatening
sub validate {
my $session = shift;
unless ($session->{data}->{_session_id} =~ /^([\w\d\_\-\.]+)$/) {
die "Invalid ID value";
}
view all matches for this distribution
view release on metacpan or search on metacpan
AuthChecker.pm view on Meta::CPAN
PerlSetVar MaxFailedAttempts 10
PerlSetVar RedirectURI /
require valid-user
Example.
Your old .htaccess file looks like:
AuthName "My secret area"
AuthType Basic
AuthUserFile /path/to/my/.htpasswd
require valid-user
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/AuthCookie.pm view on Meta::CPAN
only limited set of characters.
=head2 logout($r)
This is simply a convenience method that unsets the session key for
you. You can call it in your logout scripts. Usually this looks like
C<$r-E<gt>auth_type-E<gt>logout($r);>.
=head2 authenticate($r)
This method is one you'll use in a server config file (httpd.conf,
lib/Apache/AuthCookie.pm view on Meta::CPAN
If you want to let users log themselves out (something that can't be
done using Basic Auth), you need to create a logout script. For an
example, see t/htdocs/docs/logout.pl. Logout scripts may want to take
advantage of AuthCookie's C<logout()> method, which will set the
proper cookie headers in order to clear the user's cookie. This
usually looks like C<$r-E<gt>auth_type-E<gt>logout($r);>.
Note that if you don't necessarily trust your users, you can't count
on cookie deletion for logging out. You'll have to expire some
server-side login information too. AuthCookie doesn't do this for
you, you have to handle it yourself.
lib/Apache/AuthCookie.pm view on Meta::CPAN
my $date = localtime;
my $ses_key = MD5->hexhash(join(';', $date, $PID, $PAC));
save C<$ses_key> along with the user's login, and return C<$ses_key>.
Now C<authen_ses_key()> looks up the C<$ses_key> passed to it and
returns the saved login. I use Oracle to store the session key and
retrieve it later, see the ToDo section below for some other ideas.
=head2 TO DO
view all matches for this distribution
view release on metacpan or search on metacpan
AuthCookieDBI.pm view on Meta::CPAN
if ( $c{DBI_encryptiontype} eq 'none' ) {
$session_key = $encrypted_session_key;
}
else {
# Check that this looks like an encrypted hex-encoded string.
unless ( $encrypted_session_key =~ /^[0-9a-fA-F]+$/ ) {
$r->log_reason(
"Apache::AuthCookieDBI: encrypted session key $encrypted_session_key doesn't look like it's properly hex-encoded for auth realm $auth_name",
$r->uri
);
view all matches for this distribution
view release on metacpan or search on metacpan
AuthCookie.pm view on Meta::CPAN
mechanism.
=item * logout()
This is simply a convenience method that unsets the session key for
you. You can call it in your logout scripts. Usually this looks like
C<$r-E<gt>auth_type-E<gt>logout($r);>.
=item * send_cookie($session_key)
By default this method simply sends out the session key you give it.
AuthCookie.pm view on Meta::CPAN
If you want to let users log themselves out (something that can't be
done using Basic Auth), you need to create a logout script. For an
example, see t/eg/logout.pl. Logout scripts may want to take
advantage of AuthCookie's C<logout()> method, which will set the
proper cookie headers in order to clear the user's cookie. This
usually looks like C<$r-E<gt>auth_type-E<gt>logout($r);>.
Note that if you don't necessarily trust your users, you can't count
on cookie deletion for logging out. You'll have to expire some
server-side login information too. AuthCookie doesn't do this for
you, you have to handle it yourself.
AuthCookie.pm view on Meta::CPAN
my $date = localtime;
my $ses_key = MD5->hexhash(join(';', $date, $PID, $PAC));
save C<$ses_key> along with the user's login, and return C<$ses_key>.
Now C<authen_ses_key()> looks up the C<$ses_key> passed to it and
returns the saved login. I use Oracle to store the session key and
retrieve it later, see the ToDo section below for some other ideas.
=head1 KNOWN LIMITATIONS
view all matches for this distribution
view release on metacpan or search on metacpan
AuthCookieLDAP.pm view on Meta::CPAN
# Decrypt the session key.
my $session_key;
if ( $c{ LDAP_encryptiontype } eq 'none' ) {
$session_key = $encrypted_session_key;
} else {
# Check that this looks like an encrypted hex-encoded string.
unless ( $encrypted_session_key =~ /^[0-9a-fA-F]+$/ ) {
$r->log_reason( "Apache::AuthCookieLDAP: encrypted session key $encrypted_session_key doesn't look like it's properly hex-encoded for auth realm $auth_name", $r->uri );
return undef;
}
view all matches for this distribution
view release on metacpan or search on metacpan
AuthCookiePAM.pm view on Meta::CPAN
# Decrypt the session key.
my $session_key;
if ( $c{ PAM_encryptiontype } eq 'none' ) {
$session_key = $encrypted_session_key;
} else {
# Check that this looks like an encrypted hex-encoded string.
unless ( $encrypted_session_key =~ /^[0-9a-fA-F]+$/ ) {
$r->log_reason( "Apache::AuthCookiePAM: encrypted session key $encrypted_session_key doesn't look like it's properly hex-encoded for auth realm $auth_name", $r->uri );
return undef;
}
view all matches for this distribution
view release on metacpan or search on metacpan
AuthCookieURL.pm view on Meta::CPAN
# Disable cookies (only URL based sessions)
#PerlSetVar WhateverNoCookie 1
# Define a string that indicates to AuthCookieURL
# what a session looks like
# This can only be in main config
#PerlSetVar SessionPrefix Session-
# This block enables URL session handling
AuthCookieURL.pm view on Meta::CPAN
SetHandler perl-script
PerlHandler Apache::AuthCookieURLHandler->login
</Files>
# Note: If protecting the entire web site (from root down) then
# the action *must* be C</LOGIN> as the module looks for this string.
# better to just invalidate the session, of course
<Files LOGOUT>
AuthType Apache::AuthCookieURLHandler
PerlSetVar WhateverLogoutURI /
view all matches for this distribution
view release on metacpan or search on metacpan
AuthenCache.pm view on Meta::CPAN
modules see:
http://www.cpan.org/modules/by-module/Apache/apache-modlist.html
When a request that requires authorization is received,
AuthenCache::handler looks up the REMOTE_USER in a perl-realm shared-memory
cache (using IPC::Cache) and compares the cached password to the
sent password. A new cache is created for the first request in a realm or if
the realm's cache has expired. If the passwords match, the handler
returns OK and clears the downstream Authen handlers from the
stack. Otherwise, it returns DECLINED and allows the next
view all matches for this distribution
view release on metacpan or search on metacpan
AuthzCache.pm view on Meta::CPAN
site users. For a list of mod_perl authorization modules see:
http://www.cpan.org/modules/by-module/Apache/apache-modlist.html
When a request that requires authorization is received,
Apache::AuthzCache looks up the REMOTE_USER in a shared-memory
cache (using IPC::Cache) and compares the list of groups in the
cache against the groups enumerated within the "require"
configuration directive. If a match is found, the handler returns
OK and clears the downstream Authz handlers from the
stack. Otherwise, it returns DECLINED and allows the next
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/AxKit/Language/XSP/ObjectTaglib.pm view on Meta::CPAN
iterator => 'resource'
}, {
Define a tag called C<resources> that will loop through each C<resource>
returned by the method C<resources> on the C<course> object. When combined with
the first defined tag, the code generated looks something like this:
for $_xsp_axkit_xsp_objecttaglib_demo_resource
($_xsp_axkit_xsp_objecttaglib_demo_course->resources) {
$_xsp_axkit_xsp_objecttaglib_demo_course->name;
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/AxKit/Plugin/QueryStringCacheRegexp.pm view on Meta::CPAN
my $cache_extra;
# An extra bend to correctly make multiple-valued CGI-Parameters
# significant by concatenating them. (The whole exercise is to
# create a "axkit_cache_extra"-string that depends as little as
# possible on how the QueryString "looks"; i.e. the order of the
# parameters should not be significant unless there are multiple
# occurences of the same key)
my @args = $r->args();
my %args;
while (@args) {$args{ shift(@args) } .= shift(@args);}
view all matches for this distribution
view release on metacpan or search on metacpan
return $response, $q->param('stylesheet');
}
1;
From you browser, the request "test.cgi??DayOfWeek=Wed" will produce a document that looks like this:
<response>
<dow>Wed</dow>
<weekdays>Sunday</weekdays>
<weekdays>Monday</weekdays>
<weekdays>Tuesday</weekdays>
<weekdays>Thursday</weekdays>
<weekdays>Friday</weekdays>
<weekdays>Saturday</weekdays>
</response>
The request "test.cgi??DayOfWeek=Wed&stylesheet=/xsl/test.xsl" will produce a document that looks
like this:
<?xml-stylesheet href="/xsl/test.xsl" type="text/xsl" ?>
<response>
<dow>Wed</dow>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/BabyConnect.pm view on Meta::CPAN
This module is best understood by going through the roadmap file and the
sample programs provided with this distribution. The roadmap file is
eg/README, and the sample programs are in eg/perl.
When loading the Apache::BabyConnect module, the
module looks if the environment variable BABYCONNECT has been set to the
URI location where it can read the configuration files, and if the
the module DBI::BabyConnect has been loaded.
The startup script instantiates DBI::BabyConnect objects with caching
and persistence enabled. Each object is connected to a data source
that is described by the database descriptor. See L<DBI::BabyConnect> for
view all matches for this distribution
view release on metacpan or search on metacpan
$template->param( entry => $entry->entry);
# need to find the next and previous entries too
my @all = Apache::Blog::Entry->get_all( dirname($r->filename) );
# this looks like an overly complicated way of finding out the
# index in @all (which was got in the last line) of this entry
# is. we do that so we can tell what the one after it, and the
# one before it are, so we can have links to them.
my $this_index = 0;
$this_index++ while (defined($all[$this_index]) && $all[ $this_index ]->filename ne $entry->filename);
my $filename = $apr->param('filename');
# if the comment directory doesn't exist, we should create it
my $comment_dir = dirname($r->filename)."/$filename-comment";
if (!-d $comment_dir) {
# looks like perl 5.6.1 doesn't need the permissions bit
# on mkdir, but perl 5.005_03 does. great fun when your
# perl -c is 5.6.1, but your mod_perl is 5.005_03.
# perhaps this should tell me something about my
# development environment. perhaps i shouldn't be so
# liberal here with the permissions either.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Bootstrap.pm view on Meta::CPAN
return $self->{mp_gen} = $selected;
}
# _wanted_mp_generation()
#
# the function looks at %ENV and Makefile.PL option to figure out
# whether a specific mod_perl generation was requested.
# It uses the following logic:
# via options:
# perl Makefile.PL MOD_PERL=2
# or via %ENV:
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
view all matches for this distribution
view release on metacpan or search on metacpan
the database host. If omitted "localhost" is used.
MYSQL_USER, MYSQL_PASSWD
you credentials.
My "make test" command looks like:
MYSQL1=dbitest1 MYSQL2=dbitest2 make test
BerkeleyDB
If "BerkeleyDB" is not available a few tests are skipped.
view all matches for this distribution
view release on metacpan or search on metacpan
change group-handling in AuthzDBI. All groups related to
the given user are selected at once and then put into a
comma-separated list. This list is compared with the
required groups.
Depending upon the existence of Auth_DBI_grp_table, the
SQL-select looks either in the pwd_table or in the
grp_table for the groupid. PLEASE CHECK THE MODULE
DOCUMENTATION AND YOUR .htaccess !
0.78 February 18, 1998
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Filter.pm view on Meta::CPAN
As of version 0.07, the concept of a "deterministic" filter is supported. A
deterministic filter is one whose output is entirely determined by the contents
of its input file (whether the $r->filename file or the output of another filter),
and doesn't depend at all on outside factors. For example, a filter that translates
all its output to upper-case is deterministic, but a filter that adds a date
stamp to a page, or looks things up in a database which may vary over time, is not.
Why is this a big deal? Let's say you have the following setup:
<Files ~ "\.boffo$">
SetHandler perl-script
view all matches for this distribution
view release on metacpan or search on metacpan
Thumbnail.pm view on Meta::CPAN
PerlSetVar ThumbnailBaseDir "/usr/local/httpd/htdocs/pics"
</Location>
=head1 DESCRIPTION
Just what it looks like: creates on-the-fly thumbnails of jpeg images. There are two optional configuration directives.
=over
=item *
ThumbnailMaxSize
view all matches for this distribution
view release on metacpan or search on metacpan
t/simple_request.t view on Meta::CPAN
use strict;
# Check for Apache::FakeRequest, skip tests otherwise
eval "require Apache::FakeRequest;";
if ($@) {
print "1..0 # Skip looks like Apache2, haven't updated test yet.\n";
exit;
}
# Number of tests.
print "1..2\n";
view all matches for this distribution
view release on metacpan or search on metacpan
=item $gw->site_list
Get the list of sites to try for this request. Can be overridden to
customize the list of sites to try.
By default, this method looks through the LocationMatch sections in
the GatewayConfig file in order and returns the sites in the first
section matched.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
Apache/Geo/IP.pm view on Meta::CPAN
1;
=head1 DESCRIPTION
This module constitutes a mod_perl (version 2) interface to the
L<Geo::IP> module, which looks up in a database a country of origin of
an IP address. This database simply contains
IP blocks as keys, and countries as values. This database should be more
complete and accurate than reverse DNS lookups.
This module can be used to automatically select the geographically
view all matches for this distribution
view release on metacpan or search on metacpan
HEADRegistry.pm view on Meta::CPAN
while((my $header, $data) = split /$dlm/, $data, 2) {
# scan the incoming data for headers
if ($header && $header =~ m/^(\S+?):\s*(.*)$/) {
# if the data looks like a header, add it to the header table
($key, $value) = ($1, $2);
last unless $key;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/HeavyCGI/UnmaskQuery.pm view on Meta::CPAN
PerlPostReadRequestHandler Apache::HeavyCGI::UnmaskQuery
=head1 DESCRIPTION
This Apache Handler can be used from apache 1.3 (when
post_read_request was introduced) upwards to turn a request that looks
like an ordinary static request to the unsuspecting observer into a
query that can be handled by the CGI or Apache::Request module or by
the $r->args method.
The reason why you might want to do this lies in the fact that many
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Htgroup.pm view on Meta::CPAN
# Documentation {{{
=head1 Internals
Although this was not the case in earlier versions, the internal
data structure of the object looks something like the following:
$obj = { groupfile => '/path/to/groupfile',
groups => { group1 => { 'user1' => 1,
'user2' => 1,
'user3' => 1
view all matches for this distribution