update reply with multiple attributes from mysql table
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,
On Apr 21, 2017, at 9:00 AM, Little Snooze via Freeradius-Users <freeradius-users@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.
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. Or, write a shell script to query SQL and return the columns as individual attributes. Alan DeKok.
On Apr 21, 2017, at 9:00 AM, Little Snooze via Freeradius-Users <freeradius-users@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.
On Apr 21, 2017, at 9:09 AM, Little Snooze via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
On Apr 21, 2017, at 9:00 AM, Little Snooze via Freeradius-Users <freeradius-users@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.
That is not an excuse. It takes all of 15 minutes to build a package for your OS. See wiki.freeradius.org for instructions.
Upgrade. can't
i.e.. "won't" Alan DeKok.
it is in repos - just not repos you have configured ;-) On 21 April 2017 at 14:09, Little Snooze via Freeradius-Users < freeradius-users@lists.freeradius.org> wrote:
On Apr 21, 2017, at 9:00 AM, Little Snooze via Freeradius-Users < freeradius-users@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
participants (3)
-
Alan Buxey -
Alan DeKok -
Little Snooze