Hi Remi.
I have not tested this, but I think you could do something like this to get the
data you want:
You will have to identify the AuthBy Clause containing the SQL database you are
interested in by using the Identifier, let say with
Identifier mySQLclause
# find the AuthBy SQL we want
my $authby = &Radius::AuthGeneric::find('mySQLclause')
my $sth = $authby->prepareAndExecute($q);
my ($attr, $val);
while (($attr, $val) = $sth->fetchrow)
{
$$reply->add_attr($attr, $val);
}
Hope that helps.
Cheers.
On Mar 15, 12:22pm, Remi Godin wrote:
> Subject: (RADIATOR) Access to SQL DB via PostAuthHook
> Hi
>
> I finally got some of my PostAuthHook code to work.
> PostAuthHook sub {no strict 'subs'; \
> my $reply = bless $_[1], Radius::Radius ;\
> my $attrid = $$reply->get_attr('AttrID');
> $$reply->delete_attr('AttrID');\
> my $q = "SELECT attribute, value FROM
> newradius WHERE ((attr_id=$attrid) AND(newradius.type='R'));";\
> print $q."\n";\
> }
>
> Note the "no strict 'subs'" and bless statement.
>
> Now, I want access to the SQL DB via the PostAuthHook without opening a new
> handle to the SQL DB if possible.
> The SQL stament above will return data, two columns wide, and any number of
> rows deep.
> What do I need to do to get the values?
>
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Remi Godin Escape Communications Corp.
> Jr. Systems Support 665 Stafford Street
> Winnipeg, MB R3M 2X7
>
> [EMAIL PROTECTED] Tel: 1-877-372-2730
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
> ===
> To unsubscribe, email '[EMAIL PROTECTED]' with
> 'unsubscribe radiator' in the body of the message.
>-- End of excerpt from Remi Godin
--
Mike McCauley [EMAIL PROTECTED]
Open System Consultants Pty. Ltd Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia Consulting and development
Phone, Fax: +61 3 9598-0985 http://www.open.com.au
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, external, etc etc on Unix, Win95/8, NT, Rhapsody
===
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.