<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)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
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.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:Arial;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 107.65pt 2.0cm 107.65pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:315958177;
mso-list-type:hybrid;
mso-list-template-ids:2050262132 420622760 68157443 68157445 68157441 68157443 68157445 68157441 68157443 68157445;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Arial;
mso-fareast-font-family:"Times New Roman";}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=IT link=blue vlink=purple>
<div class=Section1>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>Yes, it’s ok.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>I’ve simply made a mistake in cut/paste
operations.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>The corret one is as follows<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>CREATE FUNCTION `mac_check`(utente VARCHAR(20),mac
VARCHAR(30)) RETURNS varchar(50)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'> DETERMINISTIC<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>BEGIN<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>IF (SELECT (SELECT
MAX((Attribute='Calling-Station-Id')) from radcheck WHERE UserName=user))<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>THEN<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'> #INSERT
into radpostauth (id, user, pass, reply, date) values ('', utente,
passwd,reply_packet, NOW());<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'> RETURN
'record already present';<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>END IF;<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'> INSERT
INTO radcheck (UserName,Attribute,op,Value) VALUES
(utente,'Calling-Station-Id',':=', mac);<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'> RETURN
'record inserted';<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>END<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>The five arguments one is because I tried to change
the content of postauth_query with a function that have to perform two actions:<o:p></o:p></span></font></p>
<p class=MsoPlainText style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:
l0 level1 lfo1'><![if !supportLists]><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><span style='mso-list:Ignore'>-<font size=1
face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><span lang=EN-GB>INSERT into
radcheck (needed to perform MAC control)<o:p></o:p></span></p>
<p class=MsoPlainText style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:
l0 level1 lfo1'><![if !supportLists]><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><span style='mso-list:Ignore'>-<font size=1
face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><span lang=EN-GB>INSERT into
radpostauth (original behaviour of postauth_query)<o:p></o:p></span></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>Regards,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>Carlo<o:p></o:p></span></font></p>
</div>
</body>
</html>