Apache-DBILogin
view release on metacpan or search on metacpan
DBILogin.pm view on Meta::CPAN
package Apache::DBILogin;
# is_member function for authz handler
# expects request object, database handle, and group for which to test
# returns valid response code
sub is_member {
my ($r, $dbh, $group) = @_;
my $sth;
eval {
# no, Oracle doesn't support binding in SET ROLE statement
$sth = $dbh->prepare("SET ROLE $group") or die $DBI::errstr;
};
return ( MP2 ? Apache2::Const::HTTP_INTERNAL_SERVER_ERROR
: Apache::Constants::HTTP_INTERNAL_SERVER_ERROR ) if ( $@ );
return ( defined $sth->execute() ) ? (MP2 ? Apache2::Const::OK
: Apache::Constants::OK)
: (MP2 ? Apache2::Const::HTTP_FORBIDDEN
: Apache::Constants::HTTP_FORBIDDEN);
}
( run in 0.596 second using v1.01-cache-2.11-cpan-2398b32b56e )