CGI-ExtDirect
view release on metacpan or search on metacpan
examples/p5httpd view on Meta::CPAN
if $public{
"$parent/"}; # either a public or a private directory is reached
goto PROTECTED
if $private{"$parent/"}; # "last" would test the wile clause once more
} while ( $parent =~ s#/[^/]*$## );
PROTECTED:
logmsg "checking password";
$passphrase =~ tr#A-Za-z0-9+/##cd; # remove non-base64 chars
$passphrase =~ tr#A-Za-z0-9+/# -_#; # convert to uuencoded format
my $len = pack( "c", 32 + 0.75 * length($passphrase) ); # compute length byte
my $decoded = unpack( "u", $len . $passphrase ); # uudecode and print
my ( $name, $password ) = split /:/, $decoded;
if ( my $encrypted_password = $encrypted_passwords{$name} ) {
return $name
if crypt( $password, $encrypted_password ) eq
$encrypted_password; # check password
}
return undef; # failed
}
__END__
( run in 0.231 second using v1.01-cache-2.11-cpan-26ccb49234f )