From a8c00314f483f35b3166e3caffb0ec0660c6b068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Thu, 14 Apr 2011 09:50:40 +0000 Subject: [PATCH] Allow subroutines to be defined in lemonldap-ng.ini (#294) --- modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm index e48cc7c04..ea9fa6842 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm @@ -20,7 +20,7 @@ use Config::IniFiles; #inherits Lemonldap::NG::Common::Conf::SOAP #inherits Lemonldap::NG::Common::Conf::LDAP -our $VERSION = '1.0.0'; +our $VERSION = '1.0.5'; our $msg; our $iniObj; @@ -240,7 +240,7 @@ sub getLocalConf { if ($loaddefault) { foreach ( $cfg->Parameters(DEFAULTSECTION) ) { $r->{$_} = $cfg->val( DEFAULTSECTION, $_ ); - if ( $r->{$_} =~ /^[{\[].*[}\]]$/ ) { + if ( $r->{$_} =~ /^[{\[].*[}\]]$/ || $r->{$_} =~ /^sub\s*{.*}$/ ) { eval "\$r->{$_} = $r->{$_}"; if ($@) { $msg = "Warning: error in file $file: $@."; @@ -259,7 +259,7 @@ sub getLocalConf { # Load section parameters foreach ( $cfg->Parameters($section) ) { $r->{$_} = $cfg->val( $section, $_ ); - if ( $r->{$_} =~ /^[{\[].*[}\]]$/ ) { + if ( $r->{$_} =~ /^[{\[].*[}\]]$/ || $r->{$_} =~ /^sub\s*{.*}$/ ) { eval "\$r->{$_} = $r->{$_}"; if ($@) { $msg = "Warning: error in file $file: $@.";