On Sun, Feb 15, 2004 at 08:24:41PM +0100, Ciolo_-^DusT^-_WebMaster wrote:
> I  make you an exaple...
> I create  a series of account that can navigate for 1 hour of effective
> traffic...
> The user login and the countdown start... then when  logout the count down
> stop... to start again the next login... in this way untill the time
> expiration.
> 
> for the other tipology I need an account of the duration of 24 hour from the
> first login...
> ex. the usr log for the first tim at 8.23 a.m. of 15th feb and he can login
> and logout for surfing untill 8.23 a.m. of 16th feb.
> 

If you want clues then this is probably what you should do :
(if you are looking for a fully functional solution - maybe later)

For first type (1 hour of effective...) you obviously
need to have placeholder for remaining time. Let's say it could be
radreply table. So, initialy you would add a record 
INSERT INTO radreply VALUES ('1','user1','Session-Timeout',':=','3600');
meaning that user1 will get one hour timeout EACH time he logs in.
Of couse this is not what you wanted. So you must create an
UPDATE command which will be fired when stop acct record is received
that will update value in radreply for that user.
Something like 
UPDATE radreply SET 
value=to_char((to_number(value,'99999')-Acct-Session-Time),'99999') WHERE 
username='user1' AND attribute='Session-Timeout';

(Acct-Session-Time is time user was online in this session)


Second type (24 hour ) is even easier because you don't have to 
calculate anything just compate datetime with one in the database.

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to