FR - Writing own queries in sql.conf - help

Saeed Ahmed saeed at
Mon Feb 6 18:30:06 CET 2006





Hi Everyone,

I am sending this message at very first time, and I hope that I'll get

My Question is that:
In sql.conf's Authorization section, can I write my own queries and can I
use the result of my own query. For detailed elaboration I will give you
following example:

I want something like that:

authorize_check_query = "SELECT id, UserName, Attribute, Value, op, uid \

          FROM ${authcheck_table} \

          WHERE Username = '%{SQL-User-Name}' \

          ORDER BY id"

in query above I created another field `uid` in my radcheck table and
suppose here I am getting some kind of user-id.

Then I want to use this value in next authorize_reply_query

something like that:
authorize_reply_query = "SELECT id, UserName, Attribute, Value, op \

          FROM ${authreply_table} \

          WHERE Username = '%{SQL-User-Name}' AND uid=
'%{authorize_check_query[5]}' \

          ORDER BY id"


Instead of authorize_check_query I can also use my own query if possible

my_own_query = "SELECT uid from mytable where Username='%{SQL-User-Name}'

and then I should be able to use the result of my_own_query. Like
my_own_query[0]; etc etc


I am using:

with MySql 5.0

Hope I will get help soon.

Thanks in advance for your time.

Saeed Ahmed

FR - User; currently Helpless;



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 7987 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.gif
Type: image/gif
Size: 57 bytes
Desc: not available
URL: <>

More information about the Freeradius-Users mailing list