LEMONLDAP::NG : little bugs in customFunctions

This commit is contained in:
Xavier Guimard 2008-11-17 15:06:58 +00:00
parent d88ae29227
commit e42c8b263f
2 changed files with 5 additions and 2 deletions

View File

@ -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 : '' )
, \@_)
}";

View File

@ -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($@);
}