Hi Paul,
You can tell if a packet is am Access-Accept by doing:
if ($reply->code eq 'Access-Accept')
{
....
Hope that helps
Cheers.
On Jan 9, 4:48pm, Paul Black wrote:
> Subject: Re: PostAuthHook
> Hi Mike,
>
> How should I check if I have an Access-Accept in the reply? Below is my
> PostAuthHook, you can see that I am printing out the authentication result,
> ${$_[2]}, the value is always 0. I'm also printing out $main::ACCEPT (From
the
> PostAuthHook documentation) and it is always 0. Could you let me know if I'm
> doing something wrong, or if I am seeing a bug in Radiator?
>
> Regards. Paul
>
>
> >PostAuthHook sub {
> > my $reply = ${$_[1]}; \
> > my $reqst = ${$_[0]}; \
> > my $status = ${$_[2]}; \
> > print "\n"; \
> > print "User = ",$reqst->get_attr('User-Name')," "; \
> > print "Days = ",$reply->get_attr('Days-Since-Added');\
> > print "ACCEPT = ", $main::ACCEPT, " "; \
> > print "Status = ", $status,"\n"; \
> > }
>
> > User = rjensen Days = ACCEPT = 0 Status = 0
> > User = gstearn Days = 129.84 ACCEPT = 0 Status = 0
> > User = gstearn Days = ACCEPT = 0 Status = 0
> > User = gstearn Days = ACCEPT = 0 Status = 0
> > User = robyn Days = ACCEPT = 0 Status = 0
> > User = airmen Days = 131.09 ACCEPT = 0 Status = 0
> > User = airmen Days = ACCEPT = 0 Status = 0
>
>
> Mike McCauley wrote:
>
> > PostAuthHook will be called for every packet, so perhaps you are seeing it
for
> > auth and accounting packets, making you think it is clled twice. IN the
hook,
> > you will have to chjeckl whether you are dealing with an Access-Accept in
the
> > reply, and therfore that the user has just successfully logged in.
> >
> > Cheers.
>
>-- End of excerpt from Paul Black
--
Mike McCauley [EMAIL PROTECTED]
Open System Consultants Pty. Ltd Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia http://www.open.com.au
Phone +61 3 9598-0985 Fax +61 3 9598-0955
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8,
NT, Rhapsody
===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.