Manager: fix SSLVarIf syntax (#2082)
This commit is contained in:
parent
f997a26e41
commit
e40568a330
|
@ -3648,7 +3648,10 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
|
|||
},
|
||||
'SSLVarIf' => {
|
||||
'default' => {},
|
||||
'type' => 'keyTextContainer'
|
||||
'keyTest' => sub {
|
||||
1;
|
||||
},
|
||||
'type' => 'keyTextContainer'
|
||||
},
|
||||
'staticPrefix' => {
|
||||
'type' => 'text'
|
||||
|
|
|
@ -358,7 +358,7 @@ sub attributes {
|
|||
msgFail => '__badUrl__',
|
||||
},
|
||||
portalCustomCss => {
|
||||
type => 'text',
|
||||
type => 'text',
|
||||
documentation => 'Path to custom CSS file',
|
||||
},
|
||||
portalStatus => {
|
||||
|
@ -3147,6 +3147,7 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
|
|||
},
|
||||
SSLVarIf => {
|
||||
type => 'keyTextContainer',
|
||||
keyTest => sub { 1 },
|
||||
default => {}
|
||||
},
|
||||
sslByAjax => {
|
||||
|
|
|
@ -32,12 +32,17 @@ sub init {
|
|||
sub extractFormInfo {
|
||||
my ( $self, $req ) = @_;
|
||||
my $field = $self->conf->{SSLVar};
|
||||
if ( $req->env->{SSL_CLIENT_I_DN}
|
||||
and my $tmp =
|
||||
$self->conf->{SSLVarIf}->{ $req->env->{SSL_CLIENT_I_DN} } )
|
||||
{
|
||||
$field = $tmp;
|
||||
if ( $req->env->{SSL_CLIENT_I_DN} ) {
|
||||
$self->logger->debug(
|
||||
'Received SSL issuer ' . $req->env->{SSL_CLIENT_I_DN} );
|
||||
|
||||
if ( my $tmp =
|
||||
$self->conf->{SSLVarIf}->{ $req->env->{SSL_CLIENT_I_DN} } )
|
||||
{
|
||||
$field = $tmp;
|
||||
}
|
||||
}
|
||||
$self->logger->debug("Using SSL environment variable $field");
|
||||
if ( $req->user( $req->env->{$field} ) ) {
|
||||
$self->userLogger->notice( "GoodSSL authentication for " . $req->user );
|
||||
return PE_OK;
|
||||
|
|
Loading…
Reference in New Issue
Block a user