Thanks Phil. It worked very well (that's what I was looking for). <div><br></div><div>Thanks in advance.<br><br><div class="gmail_quote">On Tue, Jul 31, 2012 at 3:31 PM, Phil Mayers <span dir="ltr"><<a href="mailto:p.mayers@imperial.ac.uk" target="_blank">p.mayers@imperial.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im HOEnZb">On 31/07/12 13:19, Andrei Petru Mura wrote:<br>
</div><div class="im HOEnZb"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I declared a new attribute on FR dictionary, called<br>
CarboSolutions-NotBefore. This attribute should contain the data time as<br>
a string before what the user should not be able to authenticate. That<br>
attribute is placed in radcheck table (like: CarboSolutions-NotBefore >=<br>
20120801). I tried to deal with that following some threads from that<br>
forum on similar issues, that sooner or later leads to unlang<br>
procedures. I also read the unlang's man page. But I can't understand<br>
how to deal with unlang. Can anyone help me to obtain what I need?<br>
<br>
What I need: I need that every authentication request, should contain an<br>
CarboSolutions-NotBefore field with current date.<br>
</blockquote>
<br></div><div class="HOEnZb"><div class="h5">
It isn't very clear what you want to do here, I'm afraid.<br>
<br>
What have you tried?<br>
<br>
If I understand you correctly, you want to store an attribute in the "radcheck" table that contains a date, and compare that date to "today".<br>
<br>
If so, you can do this:<br>
<br>
authorize {<br>
 ...<br>
 # put todays date into the attribute<br>
 update request {<br>
   CarboSolutions-NotBefore := "%Y%m%d"<br>
 }<br>
 # run SQL module<br>
 sql<br>
<br>
 ...<br>
}<br>
<br>
...and in your radcheck table:<br>
<br>
insert into radcheck (username,attribute,op,val) values (<br>
  'username',<br>
  'CarboSolutions-NotBefore',<br>
  '>=',<br>
  '20120731'<br>
);<br>
-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/<u></u>list/users.html</a><br>
</div></div></blockquote></div><br></div>