On 10 Dec 2015, at 12:57, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On 10 Dec 2015, at 12:42, Franks Andy (IT Technical Architecture Manager) <Andy.Franks@sath.nhs.uk> wrote:
Hi all, I'm trying to do something a bit fiddly. I'm sure I've asked this before but google doesn't help. Can we pass back multiple attributes from a sql xlat yet on 3.1.0? If not, is there a reverse of %{Attribute-Name[*]} that could translate my value1\nvalue2 from an SQL stored procedure into attribute[1]=value1, attribute[2]=value2 etc? If not, has anyone come up with a clean way to iterate through and do the equivalent via += a number of times? It seems I can use explode to get the number of delimiters (maybe I'm using it wrongly).
Maybe I'm missing something REALLY simple. Wouldn't be the first time. :-~
You can do it with maps IIRC:
map sql <query> { <radius attr> += <sql column> }
And then use the pairs xlat. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2