Insert applied rule number in logs (debug mode)

environments/ppa-mbqj77/deployments/1
Xavier Guimard 12 years ago
parent cdafff7458
commit d20489ba9a
  1. 7
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm
  2. 2
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm

@ -1505,9 +1505,12 @@ sub isUnprotected {
sub grant {
my ( $class, $uri ) = splice @_;
for ( my $i = 0 ; $i < $locationCount ; $i++ ) {
return &{ $locationCondition->[$i] }($datas)
if ( $uri =~ $locationRegexp->[$i] );
if ( $uri =~ $locationRegexp->[$i] ) {
$class->lmLog( 'debug', 'Regexp ' . ( $i + 1 ) . ' match' );
return &{ $locationCondition->[$i] }($datas);
}
}
$class->lmLog( 'debug', 'Apply default rule' );
return &$defaultCondition($datas);
}

@ -173,6 +173,7 @@ sub grant {
my $vhost = $apacheRequest->hostname;
for ( my $i = 0 ; $i < $locationCount->{$vhost} ; $i++ ) {
if ( $uri =~ $locationRegexp->{$vhost}->[$i] ) {
$class->lmLog( 'debug', "$vhost: Regexp " . ( $i + 1 ) . ' match' );
return &{ $locationCondition->{$vhost}->[$i] }($datas);
}
}
@ -183,6 +184,7 @@ sub grant {
);
return 0;
}
$class->lmLog( 'debug', "$vhost: Apply default rule" );
return &{ $defaultCondition->{$vhost} }($datas);
}

Loading…
Cancel
Save