register-approval
Christophe Maudoux 6 years ago
parent 8903874b98
commit 5eaf00601e
  1. 11
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm
  2. 5
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm
  3. 11
      lemonldap-ng-manager/site/htdocs/static/forms/ruleContainer.html

@ -280,6 +280,7 @@ sub locationRulesInit {
$class->tsv->{locationCount}->{$vhost} = 0;
foreach my $url ( sort keys %{$rules} ) {
my ( $cond, $prot ) = $class->conditionSub( $rules->{$url} );
$class->logger->debug("+++ " . $cond);
unless ($cond) {
$class->tsv->{maintenance}->{$vhost} = 1;
$class->logger->error(
@ -296,14 +297,9 @@ sub locationRulesInit {
push @{ $class->tsv->{locationCondition}->{$vhost} }, $cond;
push @{ $class->tsv->{locationProtection}->{$vhost} }, $prot;
push @{ $class->tsv->{locationRegexp}->{$vhost} }, qr/$url/;
# $class->logger->debug("**** -> " . Data::Dumper::Dumper($cond));
# push @{ $class->tsv->{locationRequiredLevel}->{$vhost} },
# $cond =~ /\(\(\?#(\d)\)\)$/ ? $1
# : undef;
# $cond =~ s/\(\(\?#\d+\)\)$//;
push @{ $class->tsv->{locationConditionText}->{$vhost} },
$cond =~ /^\(\?#(.*?)\)/ ? $1
: $cond =~ /^(.*?)##(.+)$/ ? $2
$url =~ /^\(\?#(.*?)\)/ ? $1
: $url =~ /^(.*?)##(.+)$/ ? $2
: $url;
$class->tsv->{locationCount}->{$vhost}++;
}
@ -453,6 +449,7 @@ sub postUrlInit {
# @return array (ref(sub), int)
sub conditionSub {
my ( $class, $cond ) = @_;
$cond =~ s/\(\?#(\d+)\)$//;
my ( $OK, $NOK ) = ( sub { 1 }, sub { 0 } );
# Simple cases : accept and deny

@ -264,9 +264,8 @@ sub _scanNodes {
hdebug(' locationRules');
my $k =
$leaf->{comment}
? "(?#$leaf->{comment})$leaf->{re}"
: $leaf->{re};
$k .= "((?#$leaf->{level}))" if $leaf->{level};
? "(?#$leaf->{comment}&AuthnLevel=$leaf->{level})$leaf->{re}"
: "(?#&AuthnLevel=$leaf->{level})$leaf->{re}";
$self->set( $target, $key, $k, $leaf->{data} );
}
else {

@ -5,10 +5,10 @@
<table class="table table-striped">
<thead>
<tr>
<th width="20%" trspan="comments"></th>
<th width="30%" trspan="regexps"></th>
<th width="48%" trspan="rules"></th>
<th width="2%" trspan="rulesAuthnLevel"></th>
<th width="10%" trspan="comments"></th>
<th width="20%" trspan="regexps"></th>
<th width="47%" trspan="rules"></th>
<th width="3%" trspan="rulesAuthnLevel"></th>
<th />
</tr>
</thead>
@ -32,6 +32,9 @@
<td ng-if="s.re!='default'">
<input type="number" class="form-control" ng-model="s.level"/>
</td>
<td ng-if="s.re=='default'">
<p><strong><span trspan="defaultVHLevel"></span></strong></p>
</td>
<td>
<span ng-if="s.re!='default'" class="link text-danger glyphicon glyphicon-minus-sign" ng-click="del(currentNode.nodes,$index)"/>
<span ng-if="$last" class="link text-success glyphicon glyphicon-plus-sign" ng-click="menuClick({title:'newRule'})"/>

Loading…
Cancel
Save