acct_unique with more than one Class attribute

Brian Candler b.candler at pobox.com
Fri Mar 24 10:59:27 CET 2017


On 24/03/2017 09:48, Andrea Gabellini wrote:
> as a workaround I tried to use &Class[n] instead of &Class. The Class
> attribute is added in the reply as the last thing in post-auth. So if
> the NAS doesn't touch the list, probably this works.
>
> Is there a better solution?

http://networkradius.com/doc/3.0.10/unlang/foreach.html

It says "The foreach statement loops over a list of attributes", but I 
think it means "The foreach statement loops over all the instances of a 
specified attribute".  Example:

https://lists.freeradius.org/pipermail/freeradius-users/2014-February/070473.html

Or, if you can rewrite the whole test as a single regexp, then you try:

     if (&Class[*] =~ /regexp(captures)/) { ... }




More information about the Freeradius-Users mailing list