Custom functions

Custom functions allow to extend LL::NG, they can be used in headers, rules or form replay data.

Create your Perl module with custom functions. You can name your module as you want, for example

vi /root/
package SSOExtensions;
sub function1 {
  my $portal = shift;
  my $param = shift;
  # Your nice code here
  return $param
The first parameter passed to the custom function is the LL::NG portal object.

Your module has to be loaded by Apache (for example after Handler load):

# Perl environment
PerlRequire /var/lib/lemonldap-ng/handler/
PerlRequire /root/
PerlOptions +GlobalRequest

Go in Manager, General Parameters » Advanced Parameters » Custom functions and set:


You can now use your function in a macro, an header or an access rule, for example:

Custom-Header => function1($uid)