On 17 Dec 2015, at 09:47, Alan DeKok <aland@deployingradius.com> wrote:
On Dec 17, 2015, at 4:50 AM, Franks Andy (IT Technical Architecture Manager) <Andy.Franks@sath.nhs.uk> wrote:
Ideally, I'd like to expand in an if statement and compare, i.e. if ( "%{xlat:control:Tmp-Integer-1[%{control:Tmp-Integer-0}]}" > 1 ),
Hmm... you shouldn't be able to dynamically expand non-string attributes. The idea behind %{xlat:} is that you could do something like:
Tmp-String-0 := "sql: SELECT ..."
and then do:
Blah = "%{xlat:Tmp-String-0}"
i.e. the contents of the %{xlat} expansion are another string to be expanded.
You're not using it that way. You're trying to dynamically expand an array reference, and then use that to get an integer. And you're *not* dynamically expanding the integer.
So the %{xlat} expansion is not what you want. You want something else. Something which isn't yet implemented.
I'll see if I can think of something.
He wants: &Attribute[&index] Which is pretty easy to implement. Just the tmpl parser and the tmpl cursor code needs to change. I believe everything uses that now for resolving array offsets in attributes. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2