[RADIATOR] Radiator / LDAP / matching on multi-valued field

Heikki Vatiainen hvn at open.com.au
Wed Feb 23 13:08:04 UTC 2022


On 22.2.2022 21.44, Dave Kitabjian wrote:
>>           PostSearchHook sub { my @hash = $_[4]->get('pager'); \
>>                  my @username = $_[4]->get('sAMAccountName'); \
>>                  system('/opt/radiator/radiator/goodies/inserttotp.sh', at username, at hash); \
>>                  return 1 ;}
> 
> but the syntax eludes me. I tried:
> 
>          main::log($main::LOG_DEBUG, "PostSearchHook: perform upsert to provision user", $p);\
> 
> and also
> 
>          $_[0]->log($main::LOG_DEBUG, "PostSearchHook: perform upsert to provision user", $p);\
> 
> but neither works.
Most likely $p is not known above. Otherwise it looks good.

Below are a couple of ways to do it. I'd choose the second. $self, AKA 
$_[0], refers to the AuthBy LDAP2 object that calls this hook. For this 
reason the 1st and 2nd options do the same thing.

The 3rd goes through the global logger. This usually doesn't matter but 
if you have configured something like this, then the message from the 
1st log call wouldn't go to %L/auth-ldap-log

Trace 3
<AuthBy LDAP2>
   <Log FILE>
     Trace 4
     Filename %L/auth-ldap-log
   </Log>
   # ...
</AuthBy>

PostSearchHook sub { \
   $_[0]->log($main::LOG_DEBUG, "PostSearchHook1: perform upsert to 
provision user", $_[2]);\

   my $self = $_[0]; my $p = $_[2]; \
   $self->log($main::LOG_DEBUG, "PostSearchHook2: perform upsert to 
provision user", $p);\

   main::log($main::LOG_DEBUG, "PostSearchHook3: perform upsert to 
provision user", $p);\

};


Thanks,
Heikki

-- 
Heikki Vatiainen
OSC, makers of Radiator
Visit radiatorsoftware.com for Radiator AAA server software


More information about the radiator mailing list