From ff7976ff7cd8a0a703168b85e4150d68dbee77c3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 6 Apr 2006 10:11:33 +0000 Subject: [PATCH] =?utf8?q?Men=C3=BC:=20Zu=20viele=20Eintr=C3=A4ge=20wurden?= =?utf8?q?=20entfernt,=20wenn=20bestimmte=20Eintr=C3=A4ge=20nicht=20erlaub?= =?utf8?q?t=20sind.=20[Merge=20von=201173=20aus=20dem=20LINET=20prog=20Rep?= =?utf8?q?o]?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Menu.pm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/SL/Menu.pm b/SL/Menu.pm index a3fa3e564..bef524266 100644 --- a/SL/Menu.pm +++ b/SL/Menu.pm @@ -150,11 +150,8 @@ sub access_control { @menu = grep { /^${menulevel}--/ } @{ $self->{ORDER} }; } - my @a = split /;/, $myconfig->{acs}; - my $excl = (); - - # remove --AR, --AP from array - grep { ($a, $b) = split /--/; s/--$a$//; } @a; + my @a = split /;/, $myconfig->{acs}; + my %excl; map { $excl{$_} = 1 } @a; @@ -166,5 +163,18 @@ sub access_control { return @a; } +sub generate_acl { + my ($self, $menulevel, $hash) = @_; + + my @items = $self->access_control(\%main::myconfig, $menulevel); + + $menulevel =~ s/[^A-Za-z_\/\.\+\-]/_/g; + $hash->{"access_" . lc($menulevel)} = 1 if ($menulevel); + + foreach my $item (@items) { + $self->generate_acl($item, $hash); #unless ($menulevel); + } +} + 1; -- 2.20.1