update reply with multiple attributes from mysql table

Little Snooze littlesnooze at yahoo.fr
Fri Apr 21 15:00:03 CEST 2017


Hello,

I'm running freeradius v3.0.4 (and can't run later version).

I would like to update reply with all attributes concerning a specific 
user, from a mysql table.

Is there a way to do that?


I tried this solution, found in previous post, in this mailing list:


update control {
                         Tmp-String-0 := "%{sql:SELECT 
CONCAT(attribute,'#',op,'#',value) from specreply2lns where username = 
'%{User-Name}'}"
                 }
                 if ("%{explode:&control:Tmp-String-0 #}" > 0) {
                         foreach &control:Tmp-String-0 {
                                 if ("%{Foreach-Variable-0}" =~ 
/^([^=]+)=(.*)$/) {
                                         update reply {
                                                 "%{1}" "%{2}" "%{3}"
                                         }
                                 }
                         }
                 }

pb is "explode" module doesn't available in earlier version of FR  3.0.7 :-(

Is there a way to do that in unlang and FR V3.0.4?


Many thanks,






More information about the Freeradius-Users mailing list