RE: SQLcounter patch - Addition of reply-attribute

2006-10-23 Thread Jonathan De Graeve
 Jonathan De Graeve [EMAIL PROTECTED] wrote:
 I just made a patch against 1.1.3 for the SQLcounter module.
 
   Please submit patches on bugs.freeradius.org.  It's easier to manage
 them that way.
 
As requested:

http://bugs.freeradius.org/showattachment.cgi?attach_id=187

--
Jonathan De Graeve
IMELDA vzw
Informatica Dienst
Network System Engineer
[EMAIL PROTECTED]
+32(0)15/50.52.98


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


Re: SQLcounter patch - Addition of reply-attribute

2006-10-22 Thread Alan DeKok
Jonathan De Graeve [EMAIL PROTECTED] wrote:
 I just made a patch against 1.1.3 for the SQLcounter module.

  Please submit patches on bugs.freeradius.org.  It's easier to manage
them that way.

 I'm planning the following additions:
 
 The ability to override the reject behaviour with an accept but adding
 attributes.
 
 For example: if the user has reached his volume limit, accept the user
 but add speed-limitation attributes.

  That's really what multiple module are for.  Have the sqlcounter
module return a special return code when the user is over the limit,
and use module failover to switch on that return code, and run another
module.

 -   char *counter_name; /* Daily-Session-Time */
 -   char *check_name;   /* Max-Daily-Session */
 -   char *key_name; /* User-Name */
 +   char *counter_name; /* Daily-Session-Time */

  Why?  Gratuitous whitespace changes don't belong in a patch.

 -   if ((reply_item = pairfind(request-reply-vps,
 PW_SESSION_TIMEOUT)) != NULL) {
 +   /* if ((reply_item = pairfind(request-reply-vps,
 PW_SESSION_TIMEOUT)) != NULL) { */

  If you're changing code PLEASE do not leave the old code in
comments.  It's confusing, and pointless.  CVS will tell you what the
old code was.  This practice is just unnecessary.

  Alan DeKok.
--
  http://deployingradius.com   - The web site of the book
  http://deployingradius.com/blog/ - The blog
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: SQLcounter patch - Addition of reply-attribute

2006-10-22 Thread Jonathan De Graeve
   That's really what multiple module are for.  Have the sqlcounter
 module return a special return code when the user is over the limit,
 and use module failover to switch on that return code, and run another
 module.

Ok, any idea on the return code to be used?
 
  -   char *counter_name; /* Daily-Session-Time */
  -   char *check_name;   /* Max-Daily-Session */
  -   char *key_name; /* User-Name */
  +   char *counter_name; /* Daily-Session-Time */
 
   Why?  Gratuitous whitespace changes don't belong in a patch.

My bad, sorry

 
  -   if ((reply_item = pairfind(request-reply-vps,
  PW_SESSION_TIMEOUT)) != NULL) {
  +   /* if ((reply_item = pairfind(request-reply-vps,
  PW_SESSION_TIMEOUT)) != NULL) { */
 
   If you're changing code PLEASE do not leave the old code in
 comments.  It's confusing, and pointless.  CVS will tell you what the
 old code was.  This practice is just unnecessary.

This was for internal purposes only. I'll submit the patch in the form
you want it to bugs.freeradius.org. I hope its compatible with the CVS
code.

J.


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