Opposite of Expiraton attribute?

Matthew George mgeorge at geores.net
Mon Jun 20 15:28:02 CEST 2011


Works perfectly!!!

Thank you so much Phil.

-------------------------------

raddb/dictionary: 
ATTRIBUTE       Current-Date            3000    string


raddb/sites-enabled/xx: 
authorize {
   ...
   update request {
     Current-Time-Date := " %m-%d-%Y"
   }
   sql
   ...
} 


MySQL radcheck table
+----+----------+--------------+----+------------+
| id | username | attribute    | op | value      |
+----+----------+--------------+----+------------+
|  5 | test     | Current-Date | =  | 06-21-2011 |
+----+----------+--------------+----+------------+

Works like a charm. If you use the == operator it will not work, has to be
=, >= or <=.

-----Original Message-----
From: freeradius-users-bounces+mgeorge=geores.net at lists.freeradius.org
[mailto:freeradius-users-bounces+mgeorge=geores.net at lists.freeradius.org] On
Behalf Of Phil Mayers
Sent: Monday, June 20, 2011 6:01 AM
To: freeradius-users at lists.freeradius.org
Subject: Re: Opposite of Expiraton attribute?

On 06/20/2011 10:53 AM, Phil Mayers wrote:

> %S expands to an "SQL time"; e.g. a few minutes ago:
>
> 2011-06-20 10:48:49
>
> ...so in radcheck you can put:
>
> Current-Time-Date >= 2011-07-01 00:00:00

FYI, there is also:

%D

...which expands to:

20110701

...so you can use this to populate a Current-Date attribute, do day
comparisons without time, and optionally use the build-in Current-Time to
compare times within the day.
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html




More information about the Freeradius-Users mailing list