update reply with multiple attributes from mysql table

Alan Buxey alan.buxey at gmail.com
Fri Apr 21 17:09:05 CEST 2017


it is in repos - just not repos you have configured ;-)

On 21 April 2017 at 14:09, Little Snooze via Freeradius-Users <
freeradius-users at lists.freeradius.org> wrote:

> On Apr 21, 2017, at 9:00 AM, Little Snooze via Freeradius-Users <
> freeradius-users at lists.freeradius.org> wrote:
>
>> I'm running freeradius v3.0.4 (and can't run later version).
>>>
>>    You can always run a later version.  The only reason not to is
>> political.
>>
> exactly. not in repos.
>
>>
>> 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:
>>>
>>    That would be the solution.
>>
>> 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
>>> :-(
>>>
>>    Yup.
>>
>> Is there a way to do that in unlang and FR V3.0.4?
>>>
>>    Upgrade.
>>
> can't
>
>>
>>    Or, write a shell script to query SQL and return the columns as
>> individual attributes.
>>
>>    Alan DeKok.
>>
>> ok. thanks.
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list
> /users.html
>


More information about the Freeradius-Users mailing list