Re: radiusd and time limit for one day

2001-08-27 Thread Dan Perik

Thank you all very much for your answer(s).  I think that's what I'm looking for.  Now 
to find time to implement it...

--
- Dan Perik
Computer Services Department
Lapilo Center
New Tribes Mission - PNG




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



Re: Re[2]: radiusd and time limit for one day

2001-08-24 Thread aland

 Kostas Kalevras <[EMAIL PROTECTED]> wrote:
> No, it WILL update the Session-Timeout attribute. Take a look at the code
> around line 530:

  Hmm.. I learn something every day. :)

  Alan DeKok.

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



Re: Re[2]: radiusd and time limit for one day

2001-08-24 Thread Kostas Kalevras

On Fri, 24 Aug 2001 [EMAIL PROTECTED] wrote:

>   The only problem here is that it doesn't update the Session-Time
> attribute.  So once they've logged, they can stay in as long as they
> want.

No, it WILL update the Session-Timeout attribute. Take a look at the code
around line 530:

/*
 * If we are near a reset then add the next limit, so that the user will
 * not need to login again
 */

if (res >= (data->reset_time - request->timestamp))
res += check_vp->lvalue;

DEBUG2("rlm_counter: (Check item - counter) is greater than zero");
if ((reply_item = pairfind(request->reply->vps, PW_SESSION_TIMEOUT)) != NULL) {
if (reply_item->lvalue > res)
reply_item->lvalue = res;
} else {
if ((reply_item = paircreate(PW_SESSION_TIMEOUT, PW_TYPE_INTEGER)) == NULL) {
radlog(L_ERR|L_CONS, "no memory");
return RLM_MODULE_NOOP;
}
reply_item->lvalue = res;
pairadd(&request->reply->vps, reply_item);
}


--
kkalev



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



Re: Re[2]: radiusd and time limit for one day

2001-08-24 Thread aland

Michael Chernyakhovsky <[EMAIL PROTECTED]> wrote:
> Look at radiusd.conf.
> module counter

  The only problem here is that it doesn't update the Session-Time
attribute.  So once they've logged, they can stay in as long as they
want.

  There is, however, a solution to this.  Put the users in a special
group, and key Session-Time on that:

DEFAULT  Group == "onehour", Daily-Session-Time > 3600, Auth-Type := Reject
 Reply-Message = "You've used up more than one hour today"

DEFAULT   Group == "onehour"
  Session-Timeout = 3600,
  Fall-Through = Yes


  Alan DeKok.

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



Re[2]: radiusd and time limit for one day

2001-08-24 Thread Michael Chernyakhovsky

Hello, Dan!


> I think I know what he means, because I'd like to do the same thing here.  That
> is, limit someone's dialin time to 1 hour (or whatever) per day.  So today he can
> log in for one hour.  Once that hour's up, he has to wait until tomorrow. He'll
> get another hour tomorrow. And so on.  Is that possible, and if so how?

Look at radiusd.conf.
module counter
=8<===
#  This module takes an attribute (count-attribute), which MUST
#  be an 'integer' or 'time' attribute.  It also takes a key,
#  and creates a counter for each unique key.  The count is
#  incremented when accounting packets are received by the
#  server.  The value of the increment is the value of the
#  count-attribute.
#
#  The 'reset' parameter defines when the counters are all reset to
#  zero.  It can be hourly, daily, weekly, or monthly.
#
#  The counter-name is the name of the attribute in the 'users'
#  file used to access that counter.  e.g.
#
#  DEFAULT  Daily-Session-Time > 3600, Auth-Type = Reject
#  Reply-Message = "You've used up more than one hour today"
counter {
filename = ${raddbdir}/db.counter
key = User-Name
count-attribute = Acct-Session-Time
reset = daily
counter-name = Daily-Session-Time
check-name = Max-Daily-Session
allowed-servicetype = Framed-User
cache-size = 5000
}
=8<===



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



Re: radiusd and time limit for one day

2001-08-23 Thread Kostas Kalevras

On Fri, 24 Aug 2001, Dan Perik wrote:

> 
> I think I know what he means, because I'd like to do the same thing here.  That
> is, limit someone's dialin time to 1 hour (or whatever) per day.  So today he can
> log in for one hour.  Once that hour's up, he has to wait until tomorrow. He'll
> get another hour tomorrow. And so on.  Is that possible, and if so how?
> 
> - Dan Perik

Take a look at rlm_counter.

--
kkalev


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



Re: radiusd and time limit for one day

2001-08-23 Thread Dan Perik


I think I know what he means, because I'd like to do the same thing here.  That
is, limit someone's dialin time to 1 hour (or whatever) per day.  So today he can
log in for one hour.  Once that hour's up, he has to wait until tomorrow. He'll
get another hour tomorrow. And so on.  Is that possible, and if so how?

- Dan Perik

Paul Foxton wrote:

> Hi,
>
> Not 100% surewhat you want to do, but if you mean you want to set the time a
> user can log in: yes it is possible, with Login-Time.
>
> You need to specify this in the first line of your entry for the user in the
> users file as follows:
>
> usernameAuth-Type := local, Password == "password", Login-Time :=
> "Al0800-0900"
> etc...
>
> This would only allow access between 8 & 9 in the morning on any day of the
> week (Al).
>
> Have a look in the /doc/README file, it tells you your options for what you
> can set.
>
> cheers,
>
> Paul
>
> > -Original Message-
> > From: Ronald Warner [mailto:[EMAIL PROTECTED]]
> > Sent: 23 August 2001 02:54
> > To: [EMAIL PROTECTED]
> > Subject: radiusd and time limit for one day
> >
> >
> > time limit is easy to set...  However, is it possible to
> > limit that time
> > limit for a specific period of time.  For example, the user can only
> > dial-in for only one hour a day.  Thanks.
> >
> > -
> > List info/subscribe/unsubscribe? See
> > http://www.freeradius.org/list/users.html
> >
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

--
- Dan Perik
Computer Services Department
Lapilo Center
New Tribes Mission - PNG




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



RE: radiusd and time limit for one day

2001-08-23 Thread Paul Foxton

Hi,

Not 100% surewhat you want to do, but if you mean you want to set the time a
user can log in: yes it is possible, with Login-Time.

You need to specify this in the first line of your entry for the user in the
users file as follows:

usernameAuth-Type := local, Password == "password", Login-Time :=
"Al0800-0900"
etc...

This would only allow access between 8 & 9 in the morning on any day of the
week (Al).

Have a look in the /doc/README file, it tells you your options for what you
can set.

cheers,

Paul

> -Original Message-
> From: Ronald Warner [mailto:[EMAIL PROTECTED]]
> Sent: 23 August 2001 02:54
> To: [EMAIL PROTECTED]
> Subject: radiusd and time limit for one day
> 
> 
> time limit is easy to set...  However, is it possible to 
> limit that time 
> limit for a specific period of time.  For example, the user can only 
> dial-in for only one hour a day.  Thanks.
> 
> - 
> List info/subscribe/unsubscribe? See 
> http://www.freeradius.org/list/users.html
> 

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



radiusd and time limit for one day

2001-08-22 Thread Ronald Warner

time limit is easy to set...  However, is it possible to limit that time 
limit for a specific period of time.  For example, the user can only 
dial-in for only one hour a day.  Thanks.

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