3.15.6. PostSearchHook Previous topic Parent topic Child topic Next topic

This optional parameter allows you to define a Perl function that is is called after the LDAP search results have been received, and after Radiator has processed the attributes it is interested in. Hook authors can use LDAP library routines to extract other attributes and process them in any way.
PostSearchHook is called once for each LDAP result and allows changing client's parameters before it is instantiated.
PostSearchHook has the following arguments:
  • Handle to the current ClientListLDAP object
  • Reference to client Name. To change the name, set the reference to this argument
  • Reference to a hash with client configuration parameter values collected from the entry.
  • Search result entry
Here is an example of PostSearchHook:
# Do not add clients that have 'test' in their name
PostSearchHook sub {my $name = $_[1]; $$name = '' if $$name =~ 'test';}
Tip
You can change client Name as shown in the above example. If you set the name to empty string, Radiator will skip this client.