Dynamic vlan assignment

Dom Latter freeradius-users at latter.org
Thu Aug 9 14:47:11 CEST 2018



On 07/08/18 18:08, Deepak Sehrawat wrote:
> 
> Can we configure it via MySQL as well?

 From a post I made in April.  I have a long complicated query which 
checks if the user has been deleted, or the user's account has been
suspended, etc.  It returns a value which is then used in various ways.

update control {
   CustomVal := "%{sql:SELECT \
     CASE \
     WHEN (cs_suspended.value = '1') THEN 5010 \
     WHEN (u.deleted != '0') THEN 5011 \
// etc

Then the unlang code "decodes" the return value:
if ( &control:CustomVal < 5000 ) {
   update reply {
     Filter-Id := &control:CustomVal
     Reply-Message += "Accept: MAC found."
   }
}
elsif (....




More information about the Freeradius-Users mailing list