On Thu, 26 Feb 2009 16:55:00 +0200, <t...@kalik.net> wrote:

Sorry, i read mans and comments in config and try to do like you say but
it's not work as i need. I have sqlcounter:
sqlcounter noresetBytecounter {
        counter-name = Total-Max-Octets
        check-name = Max-Octets
        reply-name = ChilliSpot-Max-Total-Octets
        sqlmod-inst = sql
        key = User-Name
        reset = never
query = "SELECT (SUM(AcctInputOctets)+SUM(AcctOutputOctets)) FROM
radacct WHERE UserName='%{%k}'"
}

post-auth section in sites-enabled/default:
    Post-Auth-Type REJECT {
        attr_filter.access_reject

        if (control:Max-Octets > 0) {
            update reply {
                Reply-Message := "Traffic limit exceeded."
            }
        }

    }


Looking at that it should probably be:

control:Max-Octets (check value) < control:Total-Max-Octets (counter
value). I don't think that negative value vill go into (reply:)
ChilliSpot-Max-Total-Octets. If it doesn't work, you can check if reply
value is zero.

Total-Max-Octets also not found in control list:

"Attribute control:Total-Max-Octets was not found"


I can do like this:

        if (!reply:ChilliSpot-Max-Total-Octets) {
            update reply {
                Reply-Message := "Traffic limit exceeded."
            }
        }

but if user enter wrong password "Traffic limit exceeded." error message will be displayed.

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

Reply via email to