Re: Substring using Unlang?

2013-07-12 Thread Peter Lambrechtsen
On Wed, Jul 10, 2013 at 6:34 PM, Olivier Beytrison oliv...@heliosnet.org wrote: On 10.07.2013 07:48, Olivier Beytrison wrote: if ( ADSL-Agent-Remote-Id =~ /(.{0,31})$/ ) { if ( ADSL-Agent-Remote-Id =~ /(.{1,32})$/ ) { that's even better as it won't match an empty attribute (you never know

Re: Substring using Unlang?

2013-07-12 Thread Arran Cudbard-Bell
On 13 Jul 2013, at 00:14, Peter Lambrechtsen pe...@crypt.co.nz wrote: On Wed, Jul 10, 2013 at 6:34 PM, Olivier Beytrison oliv...@heliosnet.org wrote: On 10.07.2013 07:48, Olivier Beytrison wrote: if ( ADSL-Agent-Remote-Id =~ /(.{0,31})$/ ) { if ( ADSL-Agent-Remote-Id =~ /(.{1,32})$/ ) {

Re: Substring using Unlang?

2013-07-12 Thread Peter Lambrechtsen
On Sat, Jul 13, 2013 at 11:36 AM, Arran Cudbard-Bell a.cudba...@freeradius.org wrote: On 13 Jul 2013, at 00:14, Peter Lambrechtsen pe...@crypt.co.nz wrote: On Wed, Jul 10, 2013 at 6:34 PM, Olivier Beytrison oliv...@heliosnet.org wrote: On 10.07.2013 07:48, Olivier Beytrison wrote: if (

Re: Substring using Unlang?

2013-07-10 Thread Olivier Beytrison
On 10.07.2013 07:48, Olivier Beytrison wrote: if ( ADSL-Agent-Remote-Id =~ /(.{0,31})$/ ) { if ( ADSL-Agent-Remote-Id =~ /(.{1,32})$/ ) { that's even better as it won't match an empty attribute (you never know ...) -- Olivier Beytrison Network Security Engineer, HES-SO Fribourg Mail:

Substring using Unlang?

2013-07-09 Thread Peter Lambrechtsen
I've been looking at the options and it looks like the easiest will be to use perl or similar external module as it can't be done easily in FR 2.2.x For our subscriber authentication we use in certain situations the ADSL Remote ID as the Subscriber ID on the NAS. The issue with this is the

Re: Substring using Unlang?

2013-07-09 Thread Olivier Beytrison
On 10.07.2013 05:20, Peter Lambrechtsen wrote: In pseudo code it would be something like: if (length(ADSL-Agent-Remote-Id) 31) { update reply { strncat(SubscriberID, ADSL-Agent-Remote-Id + (strlen(ADSL-Agent-Remote-Id) - 31), 31) } } else { update reply { SubscriberID :=