I just figured this out... I do a

  my $customer = ${self}->{Identifier};

Reason im doing this:

I have multiple customers I pass the radius to and I want to be able to log
their users that logon.  However each one must
be in a seperate database so that I know what to bill them for.    So I
wanted to log them to the individual database without having to write each
hook out
....

Example:
(instead of having to write a seperate hook for each one.
Now I just need to define the Identifier and do a hook:file,
this makes the radius.cfg file look much cleaner and simpler).

sub {
 my $code = ${$_[0]}->code();
 if ($code eq 'Access-Accept')
 {
  my $username = ${$_[2]}->{OriginalUserName};
  my $customer = ${self}->{Identifier};

  open(FILE, ">>/var/log/radius/radius-${customer}");
  print FILE "${username}\n";
  close FILE;
} }

----- Original Message -----
From: "Hugh Irvine" <[EMAIL PROTECTED]>
To: "Brandon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 02, 2000 1:05 AM
Subject: Re: (RADIATOR) referencing the authby identifier


>
> Hello Brandon -
>
> On Fri, 02 Jun 2000, Brandon wrote:
> > Anyone Know?  How do you reference the AuthBy identifier via a hook?
> >
> > Example:
> >
> > <AuthBy RADIUS>
> > Identifier   customer1
> > ReplyHook file: "%D/realm.cfg"
> > </AuthBy>
> >
> > Now in the realm.cfg
> >
> > How would I reference the customer1 value.
> > I have tried...
> >
> >   my $customer = ${$_[2]}->{AuthBy}->{Identifier}
> >
> > and it doens't seem to work.
> >
>
> I posted something on this topic a short time ago (an hour or so). But it
seems
> to me you have got this around backwards, as if you are in a particular
AuthBy,
> you already know where you are?
>
> Or perhaps I don't understand what you are trying to do?
>
> regards
>
> Hugh
>
> --
> Radiator: the most portable, flexible and configurable RADIUS server
> anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
> Platypus, Freeside, Interbiller, TACACS+, PAM, external, etc, etc.
> Available on Unix, Linux, FreeBSD, Windows 95/98/2000, NT, MacOS X.
>
>


===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to