<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal-compose;
color:black;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
style='width:100.0%'>
<tr>
<td bgcolor="#A1D0EF" style='background:#A1D0EF;padding:.75pt .75pt .75pt .75pt'>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
style='width:100.0%'>
<tr>
<td width="25%" valign=bottom bgcolor=white style='width:25.0%;background:
white;padding:0in 0in 0in 0in'>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
width="100%" style='width:100.0%'>
<tr height=20 style='height:15.0pt'>
<td height=20 bgcolor="#A1D0EF" style='background:#A1D0EF;padding:0in 0in 0in 0in;
height:15.0pt'>
<p class=MsoNormal><font size=1 color=black face=Verdana><span
style='font-size:8.0pt;font-family:Verdana;color:black'> <o:p></o:p></span></font></p>
</td>
</tr>
<tr height=22 style='height:16.5pt'>
<td height=22 style='padding:0in 0in 0in 0in;height:16.5pt'>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:8.0pt;
font-family:Verdana'> <o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:8.0pt;
font-family:Verdana'><o:p></o:p></span></font></p>
</td>
<td bgcolor=white style='background:white;padding:0in 0in 0in 0in'>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:8.0pt;
font-family:Verdana'><img width=595 height=113 id="_x0000_i1025"
src="cid:image001.gif@01C62B4B.598C8240"><o:p></o:p></span></font></p>
</td>
<td width="25%" valign=top bgcolor=white style='width:25.0%;background:
white;padding:0in 0in 0in 0in'>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
width="100%" style='width:100.0%'>
<tr height=23 style='height:17.25pt'>
<td height=23 bgcolor=white style='background:white;padding:0in 0in 0in 0in;
height:17.25pt'>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:8.0pt;
font-family:Verdana'> <o:p></o:p></span></font></p>
</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 bgcolor="#A1D0EF" style='background:#A1D0EF;padding:0in 0in 0in 0in;
height:15.0pt'>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:8.0pt;
font-family:Verdana'> <o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:8.0pt;
font-family:Verdana'><o:p></o:p></span></font></p>
</td>
</tr>
<tr>
<td colspan=3 bgcolor=white style='background:white;padding:0in 0in 0in 0in'>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
width="100%" style='width:100.0%'>
<tr>
<td bgcolor=white style='background:white;padding:3.75pt 3.75pt 3.75pt 3.75pt'>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>Hi Everyone,<br>
<br>
I am sending this message at very first time, and I hope that I’ll
get response. <br>
<br>
My Question is that:<br>
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:<br>
<br>
I want something like that:<br>
<br>
authorize_check_query = "SELECT id, UserName, Attribute, Value, op,
uid \<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>
FROM ${authcheck_table} \<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>
WHERE Username = '%{SQL-User-Name}' \<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>
ORDER BY id"<br>
<br>
in query above I created another field `uid` in my radcheck table and
suppose here I am getting some kind of user-id.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>Then I want to
use this value in next authorize_reply_query<br>
<br>
something like that:<br>
authorize_reply_query = "SELECT id, UserName, Attribute, Value, op \<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>
FROM ${authreply_table} \<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>
WHERE Username = '%{SQL-User-Name}' AND uid=
'%{authorize_check_query[5]}' \<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>
ORDER BY id"<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>Instead of
authorize_check_query I can also use my own query if possible<br>
example<br>
<br>
my_own_query = “SELECT uid from mytable where Username='%{SQL-User-Name}'<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'><br>
and then I should be able to use the result of my_own_query. Like my_own_query[0];
etc etc<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#330099" face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:#330099'>I am using:<br>
<br>
freeradius-1.0.5<br>
with MySql 5.0<br>
<br>
Hope I will get help soon.<br>
<br>
Thanks in advance for your time.<o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:8.0pt;
font-family:Verdana'><o:p></o:p></span></font></p>
</td>
</tr>
<tr>
<td colspan=3 bgcolor=white style='background:white;padding:0in 0in 0in 0in'>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
width="100%" style='width:100.0%'>
<tr>
<td style='padding:3.75pt 3.75pt 3.75pt 3.75pt'>
<p><b><font size=2 face=Verdana><span style='font-size:10.0pt;font-family:
Verdana;font-weight:bold'>Regards</span></font></b><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'><br>
<b><i><span style='font-weight:bold;font-style:italic'>Saeed Ahmed<br>
<br>
</span></i></b><o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'><o:p></o:p></span></font></p>
</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td colspan=3 height=20 bgcolor=white style='background:white;padding:0in 0in 0in 0in;
height:15.0pt'>
<p class=MsoNormal align=center style='text-align:center'><font size=2
face=Verdana><span style='font-size:10.0pt;font-family:Verdana'><img
width=350 height=1 id="_x0000_i1026"
src="cid:image002.gif@01C62B4B.598C8240"><o:p></o:p></span></font></p>
</td>
</tr>
<tr>
<td colspan=3 bgcolor=white style='background:white;padding:0in 0in 0in 0in'>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
width="100%" style='width:100.0%'>
<tr>
<td style='padding:3.75pt 3.75pt 3.75pt 3.75pt'>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:7.5pt;
font-family:Verdana'>FR – User; currently Helpless;</span></font><font
size=1 face=Verdana><span style='font-size:8.0pt;font-family:Verdana'><o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'><o:p></o:p></span></font></p>
</td>
</tr>
<tr>
<td colspan=3 bgcolor="#A1D0EF" style='background:#A1D0EF;padding:0in 0in 0in 0in'>
<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'> <o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=1 face=Verdana><span style='font-size:8.0pt;
font-family:Verdana'><o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>