From a9d4ed04bb59e97a96320b5bd1efdeffa54f6536 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Thu, 26 Nov 2009 16:33:31 +0000 Subject: [PATCH] searchOn was not running --- .../lib/Lemonldap/NG/Common/Apache/Session.pm | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session.pm index d62960f5f..c985beb8f 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Apache/Session.pm @@ -17,18 +17,21 @@ BEGIN { sub Apache::Session::searchOn { my ( $class, $args, $selectField, $value, @fields ) = @_; my %res = (); - $class->get_key_from_all_sessions($args,sub{ - my $entry = shift; - my $id = shift; - return undef unless($entry->{selectField}eq $value); - if (@fields) { - $res{ $id }->{$_} = $entry->{$_} foreach (@fields); + $class->get_key_from_all_sessions( + $args, + sub { + my $entry = shift; + my $id = shift; + return undef unless ( $entry->{$selectField} eq $value ); + if (@fields) { + $res{$id}->{$_} = $entry->{$_} foreach (@fields); + } + else { + $res{$id} = $entry; + } + undef; } - else { - $res{ $id } = $entry; - } - undef; - }); + ); return \%res; }