String expansion of attributes value from database
Krzysztof Grobelak
krzysztof.grobelak at enet.ie
Tue Jul 12 18:46:08 CEST 2016
Hello Arran,
Thanks for the response.
>
> In v3.1.x you can use %{xlat:<value>}
Could you explain a little bit more how to use this feature?
I’m unclear how to apply this to the value returned from db. I suspect i need to do it in post-auth section.
I know that I can do the following:
post-auth {
update reply {
Alc-Subsc-ID-Str := "%{Alc-Client-Hardware-Addr}”
}
}
And this works but this will update all the reply packet for all successful authentication responses. And i would like to be able to do this per profile.
Like so:
<pseudo unlang>
post-auth {
if (sql:groupname == “profile_1”){ <—"just finding out this would be veery helpful"
update reply {
Alc-Subsc-ID-Str := “%{xlat: profile_1.attribute_1}”
}
}
}
</pseudo unlang>
I hope the above illustrates what i’m trying to achieve.
Actually just being able to check the returned groupname (profile) would get me out of trouble.
>
> But yeah, there should be a quoting column or something I guess. Fell free to submit patches against v4.0.x.
Would love to but i’m afraid the complexity of the server is slightly beyond my skill level :/
Regards,
Kris
More information about the Freeradius-Users
mailing list