enhanced AccessHandler.pm for httpd 2.4
This commit is contained in:
parent
1ced89908e
commit
3316cf8b3f
@ -42,7 +42,7 @@ use URI;
|
|||||||
use DBI;
|
use DBI;
|
||||||
use Digest::SHA1 qw (sha1_hex);
|
use Digest::SHA1 qw (sha1_hex);
|
||||||
|
|
||||||
use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_UNAUTHORIZED HTTP_INTERNAL_SERVER_ERROR PROXYREQ_PROXY);
|
use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_UNAUTHORIZED HTTP_INTERNAL_SERVER_ERROR PROXYREQ_PROXY AUTH_REQUIRED);
|
||||||
|
|
||||||
sub get_config
|
sub get_config
|
||||||
{
|
{
|
||||||
@ -366,6 +366,13 @@ sub __handler
|
|||||||
if (lc($cfg->{svn_read_access}) eq 'anonymous')
|
if (lc($cfg->{svn_read_access}) eq 'anonymous')
|
||||||
{
|
{
|
||||||
# grant an anonymous user the read access.
|
# grant an anonymous user the read access.
|
||||||
|
if (!defined($userid) || $userid eq '')
|
||||||
|
{
|
||||||
|
# httpd 2.4 emits the following message if the user is not set
|
||||||
|
# AH00027: No authentication done but request not allowed
|
||||||
|
# without authentication for /xxx/xxx. Authentication not configured?
|
||||||
|
$r->user('<codepot-anonymous-user>');
|
||||||
|
}
|
||||||
return Apache2::Const::OK;
|
return Apache2::Const::OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -455,4 +462,5 @@ sub handler: method
|
|||||||
close_database ($dbh);
|
close_database ($dbh);
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -3,10 +3,17 @@ package Codepot::AuthenHandler;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_UNAUTHORIZED HTTP_INTERNAL_SERVER_ERROR);
|
use Apache2::Access ();
|
||||||
|
use Apache2::RequestUtil ();
|
||||||
|
use Apache2::RequestRec ();
|
||||||
|
use Apache2::Log;
|
||||||
|
|
||||||
|
use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_UNAUTHORIZED HTTP_INTERNAL_SERVER_ERROR AUTH_REQUIRED);
|
||||||
|
|
||||||
|
use Data::Dumper;
|
||||||
sub handler: method
|
sub handler: method
|
||||||
{
|
{
|
||||||
|
my ($class, $r) = @_;
|
||||||
return Apache2::Const::OK;
|
return Apache2::Const::OK;
|
||||||
}
|
}
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user