From 3909d708d155b209138e1e7d52410f1e80e440ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Deltombe?= Date: Tue, 21 May 2013 08:18:03 +0000 Subject: [PATCH] Compute macros and local groups in alphabetical order (#596) --- lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm index e9a7fe6a5..952c0683f 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -2061,8 +2061,8 @@ sub setSessionInfo { #@return Lemonldap::NG::Portal constant sub setMacros { my $self = shift; - while ( my ( $n, $e ) = each( %{ $self->{macros} } ) ) { - $self->{sessionInfo}->{$n} = $self->safe->reval($e); + foreach (sort keys %{ $self->{macros} }) { + $self->{sessionInfo}->{$_} = $self->safe->reval( $self->{macros}->{$_} ); } PE_OK; } @@ -2074,9 +2074,9 @@ sub setMacros { sub setLocalGroups { my $self = shift; my $groups = ""; - while ( my ( $group, $expr ) = each %{ $self->{groups} } ) { - $groups .= $group . $self->{multiValuesSeparator} - if ( $self->safe->reval($expr) ); + foreach (sort keys %{ $self->{groups} } ) { + $groups .= $_ . $self->{multiValuesSeparator} + if ( $self->safe->reval( $self->{groups}->{$_} ) ); } # Join local and UserDB groups