Parse conf (#1988)
This commit is contained in:
parent
85b9095f7e
commit
836add81c0
|
@ -195,12 +195,14 @@ sub virtualHosts {
|
||||||
type => 'keyText',
|
type => 'keyText',
|
||||||
};
|
};
|
||||||
|
|
||||||
# If rule contains a comment, split it
|
# If rule contains a comment or an AuthLevel, split them
|
||||||
if ( $query eq 'locationRules' ) {
|
if ( $query eq 'locationRules' ) {
|
||||||
$res->{comment} = '';
|
$res->{comment} = '';
|
||||||
|
$res->{level} = '';
|
||||||
if ( $r =~ s/\(\?#(.*?)\)// ) {
|
if ( $r =~ s/\(\?#(.*?)\)// ) {
|
||||||
$res->{title} = $res->{comment} = $1;
|
$res->{title} = $res->{comment} = $1;
|
||||||
}
|
}
|
||||||
|
$res->{level} = $1 if ( $r =~ s/\(\?#AuthnLevel=(-?\d+)\)// );
|
||||||
$res->{re} = $r;
|
$res->{re} = $r;
|
||||||
$res->{type} = 'rule';
|
$res->{type} = 'rule';
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,8 +264,9 @@ sub _scanNodes {
|
||||||
hdebug(' locationRules');
|
hdebug(' locationRules');
|
||||||
my $k =
|
my $k =
|
||||||
$leaf->{comment}
|
$leaf->{comment}
|
||||||
? "(?#$leaf->{comment}&AuthnLevel=$leaf->{level})$leaf->{re}"
|
? "(?#$leaf->{comment})$leaf->{re}"
|
||||||
: "(?#&AuthnLevel=$leaf->{level})$leaf->{re}";
|
: $leaf->{re};
|
||||||
|
$k .= "(?#AuthnLevel=$leaf->{level})" if $leaf->{level};
|
||||||
$self->set( $target, $key, $k, $leaf->{data} );
|
$self->set( $target, $key, $k, $leaf->{data} );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user