Reverse string concatenation for multiple attributes

Arran Cudbard-Bell a.cudbardb at freeradius.org
Thu Dec 10 19:06:07 CET 2015


> On 10 Dec 2015, at 12:57, Arran Cudbard-Bell <a.cudbardb at freeradius.org> wrote:
> 
> 
>> On 10 Dec 2015, at 12:42, Franks Andy (IT Technical Architecture Manager) <Andy.Franks at 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 at freeradius.org>
FreeRADIUS development team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20151210/392b2be9/attachment.sig>


More information about the Freeradius-Users mailing list