From e42c8b263f12b5ea91a3612dea4739e746ad79e4 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Mon, 17 Nov 2008 15:06:58 +0000 Subject: [PATCH] LEMONLDAP::NG : little bugs in customFunctions --- .../lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm | 3 ++- modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm index 6eab45b54..f8e41d36c 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm @@ -270,8 +270,9 @@ sub safe { $safe->share( '&encode_base64', '$datas', '&lmSetHeaderIn', '$apacheRequest', @t ); foreach(@t) { $class->lmLog("Custom function : $_",'debug'); + $_ = "$class\::$_" unless(/::/); eval "sub $_ { - return $class\::$_(\$apacheRequest->uri + return $_(\$apacheRequest->uri . ( \$apacheRequest->args ? '?' . \$apacheRequest->args : '' ) , \@_) }"; diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm index dfd3e506b..2acb2f994 100755 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm @@ -23,8 +23,10 @@ sub _safe { $self->{_safe} = new Safe; my @t = split /\s+/, $self->{customFunctions}; foreach(@t) { + next if(__PACKAGE__->can($_)); + my $sub = "$self->{caller}::$_" unless(/::/); eval "sub $_ { - return $self->{caller}::$_(\$path,\@_); + return $sub(\$path,\@_); }"; print STDERR "$@\n" if($@); }