is there normal way to create a user that can not log on until a future date?

Rob Fowler radius at mianos.com
Tue May 27 10:39:20 CEST 2008


A.L.M.Buxey at lboro.ac.uk wrote:
> Hi,
>
>   
>> I think I can probably do it with the SQL interface by only selecting from 
>> 'check
>> records' that are current but is there a 'proper' way to do this?
>> Surely a dialup ISP would set a 'start date', before which a user can not 
>> log in?
>>     
>
> add another table eg validity, then put eg this into it:
>
>  id         | int(11)     | NO   | PRI | NULL    | auto_increment |
>  UserName   | varchar(60) | YES  |     | NULL    |                |
>  start_date | datetime    | YES  |     | NULL    |                |
>  end_date   | datetime    | YES  |     | NULL    |                |
>
> then either use SQL or eg PERL to run a quick authorize check
>
> eg validity.start_date <= NOW() and validity.end_date >= NOW()
>
> etc.  a basic test can be squeezed into 1.1.x or 2.0.x - something
> a little more inline and streamlines can be done in unlang
>
>   
This is what I had in mind if there is no native support for such. I'll 
probably do what you suggested here word for word. It almost seems a 
'proper' way as it's pretty normal to have a validity in an account table.

> another option - touched on by others, is to generate a new account
> on the flu each day - if you can access the till system via the
> RADIUS server then it could add the username details etc to
> the till after its generated. 
>
>   
I know this will work but, however simple, I'd rather not add a 
dependancy on cron and a external mysql script (although I am sure the 
locking works fine with mysql these days :) )



More information about the Freeradius-Users mailing list