Hello Stephen -
On Tue, 23 May 2000, Stephen Chen wrote:
>
> Please ignore my last question, passing parameters from SQL commands is
> working fine.
>
> We actually have multiple tables within our Oracle. The attribute value
> needed by our RAS requires lookups from 2 tables. For example, we lookup
> the user_id from the first table, and the lookup the session-timeout on the
> second table using the user_id obtain from first table.
>
> Is there a way for Radiator to make nested SQL calls to accomplish this?
> Such as the following SQL command:
> AuthSelect select SESSION_TIMEOUT from USER_FIELD_VALUES where OWNER=(
> select USER_ID from USERS where LOGIN_NAME = '%n')
>
> We tried to do 2 AuthSelect statements (see following) but it doesn't
> recognize "USER_ID" from the second statement.
>
> AuthSelect select PASS_WORD, USER_ID from USERS where LOGIN_NAME='%n'
> AuthSelect select value from USER_FIELD_VALUES where FIELD_ID=47 and OWNER=(
> select USER_ID from USERS where LOGIN_NAME = '%n')
>
> AuthColumnDef 0, PASS_WORD, check
> AuthColumnDef 1, USER_ID, reply
>
Well, you have three options here. The first is to use a stored procedure in the
database itself to do everyting you need to have done - this is the best
approach if your database supports stored procedures. Otherwise I think you will
have to use two AuthBy SQL clauses with the first one storing the USER-ID in
the reply packet as a pseudo-attribute, and the second using that
pseudo-attribute for the second AuthSelect query. This second option is
supported in Radiator 2.16 with the %{Reply:....} construct.
Finally, you could also use a PostAuthHook to do the second SQL query and
subsequent reply attribute manipulation. There are some example hooks in the
patches area here:
http://www.open.com.au/radiator/downloads/patches-2.15/hooks.txt
hth
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.