FR - Writing own queries in sql.conf - help

Saeed Ahmed saeed at n-g-c.com
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
response. 

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
example

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:

freeradius-1.0.5
with MySql 5.0

Hope I will get help soon.

Thanks in advance for your time.



Regards
Saeed Ahmed








FR - User; currently Helpless;


 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20060206/6e50f244/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 7987 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20060206/6e50f244/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.gif
Type: image/gif
Size: 57 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20060206/6e50f244/attachment-0001.gif>


More information about the Freeradius-Users mailing list