(RADIATOR) retrieving $self in hooks

PREVOSTO, Laurent Laurent.PREVOSTO at neufcegetel.fr
Mon Jul 24 06:24:33 CDT 2006


Bonjour,
 
1. The Question :
is there a generic way to retrieve $self (ie the Configurable - well
here, it happens to be a AuthBy but it could be something else - that
ran the hook) from inside of the hook itself ?
In a usual perl method $self is passed as the first argument but not in
radiator hooks...
 
2. The reason (for curious people) : 
while processing radius packets, i need to do a few treatments with a
LDAP directory (which are not basic authbyldap stuff).
So i overloaded AuthINTERNAL and AuthRADIUS so that they inherit from
both AuthINTERNAL/RADIUS and LDAP.pm. Consequently, the resulting
AuthXXXX classes contain a reference to a LDAP instance.
And the very treatments are done in AuthHook and ReplyHook... which both
need to get a hand on $self so they can invoke the LDAP.
That's why i need to use $self in hooks.
 
3. The (ugly) way i do it today :
I can overload the code so that $self is passed as a parameter in
hooks... but that's quite ugly.
There are also tricks like using $fp->{ThisAuth} in ReplyHook but it
only works in ReplyHook and it's like using an undocumented API that may
change one day...
 
4. The conclusion :
If anybody has an idea, it would be greatly appreciated...
 
Regards,
 
Laurent

--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list