How to get FR user check items override group check items

Abraham Jacob abrahamj at gmail.com
Sun Nov 17 14:57:14 UTC 2024


On Sat, Nov 16, 2024 at 7:23 PM Alan DeKok <aland at deployingradius.com> wrote:
>
>
> On Nov 16, 2024, at 4:51 AM, Abraham Jacob <abrahamj at gmail.com> wrote:
> > It is working as expected if I set the radgroupcheck op to ':='.
> >
> > From the Operator wiki page I understand that for matching as a check
> > item, the operator has to be :=.
>
>  Why are you matching it as a check item?  You're trying to send it as a reply.

Sorry, I missed to mention that I am using the sqlcounter module with
the following configuration.

sqlcounter dailycounter {
        sql_module_instance = sql
        dialect = mysql

        counter_name = Daily-Session-Time
        check_name = Session-Timeout
        reply_name = Session-Timeout

        key = User-Name
        reset = daily

        $INCLUDE ${modconfdir}/sql/counter/${dialect}/${.:instance}.conf
}


mods-config/sql/counter/mysql/dailycounter.conf:
query = "\
        SELECT SUM(acctsessiontime - GREATEST((%%b -
UNIX_TIMESTAMP(acctstarttime)), 0)) \
        FROM radacct \
        WHERE username = '%{${key}}' \
        AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%%b'"



This way I achieve 2 things.
1. Limit daily session time to Session-Timeout set, even if user is reconnecting
2. Give Access-Reject  once the limit is crossed.


Thanks,
Abraham

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


More information about the Freeradius-Users mailing list