diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safelib.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safelib.pm index 5526ea877..a04c5eb12 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safelib.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safelib.pm @@ -18,7 +18,7 @@ our $VERSION = '2.0.12'; # Not that only functions, not methods, can be written here our $functions = [ - qw(&checkLogonHours &date &dateToTime &checkDate &basic &unicode2iso &iso2unicode &groupMatch &isInNet6 &varIsInUri &has2f) + qw(&checkLogonHours &date &dateToTime &checkDate &basic &unicode2iso &iso2unicode &groupMatch &isInNet6 &varIsInUri &has2f_internal) ]; ## @function boolean checkLogonHours(string logon_hours, string syntax, string time_correction, boolean default_access) @@ -244,7 +244,7 @@ sub varIsInUri { my $json = JSON::XS->new; -sub has2f { +sub has2f_internal { my ( $session, $type ) = @_; return 0 unless $session->{_2fDevices}; diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm index 3ae4734f4..0adee8198 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm @@ -658,7 +658,7 @@ sub substitute { $expr =~ s/\binGroup\(([^)]*)\)/listMatch(\$s->{'hGroups'},$1,1)/g; # handle has2f - $expr =~ s/\bhas2f\(([^),]*)\)/has2f(\$s,$1)/g; + $expr =~ s/\bhas2f\(([^),]*)\)/has2f_internal(\$s,$1)/g; return $expr; } diff --git a/lemonldap-ng-handler/t/12-Lemonldap-NG-Handler-Jail.t b/lemonldap-ng-handler/t/12-Lemonldap-NG-Handler-Jail.t index 55ed31859..2c8cd74e2 100644 --- a/lemonldap-ng-handler/t/12-Lemonldap-NG-Handler-Jail.t +++ b/lemonldap-ng-handler/t/12-Lemonldap-NG-Handler-Jail.t @@ -69,7 +69,7 @@ ok( ok( $res = &$code, "Function works" ); ok( $res == 1, 'Get good result' ); -$sub = "sub { return(has2f(\$_[0],\$_[1])) }"; +$sub = "sub { return(has2f_internal(\$_[0],\$_[1])) }"; $code = $jail->jail_reval($sub); ok( ( defined($code) and ref($code) eq 'CODE' ), diff --git a/lemonldap-ng-handler/t/13-Lemonldap-NG-Handler-Fake-Safe.t b/lemonldap-ng-handler/t/13-Lemonldap-NG-Handler-Fake-Safe.t index d3601b28b..b4129e9f9 100644 --- a/lemonldap-ng-handler/t/13-Lemonldap-NG-Handler-Fake-Safe.t +++ b/lemonldap-ng-handler/t/13-Lemonldap-NG-Handler-Fake-Safe.t @@ -62,7 +62,7 @@ ok( ( defined($listMatch) and ref($listMatch) eq 'CODE' ), ok( &$listMatch eq '0', 'Get good result' ); # Test has2f method -my $sub7 = "sub { return(has2f(\$_[0],\$_[1])) }"; +my $sub7 = "sub { return(has2f_internal(\$_[0],\$_[1])) }"; my $has2f = $jail->jail_reval($sub7); ok( ( defined($has2f) and ref($has2f) eq 'CODE' ),