[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeradius-users
Subject:    Re: rewrite User-Name in received Access-Request - tough question :)
From:       Alan DeKok <aland () deployingradius ! com>
Date:       2012-10-28 10:17:05
Message-ID: 508D0621.9050705 () deployingradius ! com
[Download RAW message or body]

Bojan Pogacar wrote:
> Alan: I've posted so much garbage solutions, because I wanted to show
> you, that I've tried many things, before writing to this mailing list :)

  Sure.  My point is that most solutions are similar: write down a
COMPLETE description of the problem.  Then, implement it.

> Alan: Even if UserName rewrite would happen, I could track different
> users by Attribute Calling-Station-Id. I wrote this counter:

  That may work.  But as I said, you don't need to re-write the
User-Name.  So don't.

> I will write all the logic in unlang, without username rewrite. I will
> get user parameters with
> 
> update reply {
>     Session-Timeout := %{sql: SELECT 1800 - SUM(acctsessiontime - \
>                  GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \
>                  FROM radacct WHERE callingstationid =
> '%{Calling-Station-ID}' AND \
>                  UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'}
> 
> 
> .... and so on for bandwidth caping.   
> }
>
> Is there more elegant solution, or this is it?

  That's pretty much it.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic