3.41.18. PostAuthSelectHook Previous topic Parent topic Child topic Next topic

This optional parameter allows you to define a Perl function that will be run during the authentication process. The hook will be called after the AuthSelect results have been received, and before Radiator has processed the attributes it is interested in. This hook runs only once even if the DB returns multiple rows. If there are no rows, the hook is not run.
The first argument passed to the hook is a handle to the current AuthBy SQL object. The second argument is the name of the user being authenticated. The third argument is a pointer to the current request. The fourth argument is a pointer to the User object being constructed to hold the check and reply items for the user being authenticated. The fifth argument ($_[4]) is a reference to the @row resulting from AuthSelect.
# Change the flag in the first field to 'Accept' or 'Reject'
PostAuthSelectHook sub{my($self,$name,$p,$user,$row)=@_;\
      my $flag = $row->[0];\
      $row->[0] = $flag ? 'Reject’:Accept';\
      }