Policy construct for string "concatenation"

Arran Cudbard-Bell a.cudbardb at freeradius.org
Thu Oct 13 20:41:45 CEST 2011


On 13 Oct 2011, at 19:40, Ray Scholl wrote:

> Thank you –
>  
> You refer to them as variables – so I am assuming it cannot be a constant?  I must declare a variable and assign ‘otp’?

No. I said they could be attributes references or strings. You can use string constants. Like most languages double quoted strings are expanded, single quoted strings are treated as literals.

Sorry should have been My-Attr etc..

If you want to check if a user was in a specific group, you would write

if("%{clients_ldap:LDAP-Group}" == 'my_ldap_group'){
	# Do stuff
}

> sOTP := ‘otp’
> if ( “%{FreeRadius-Client-Shortname}%{sOTP}” == “%{clients_ldap-Ldap-Group}” )   {
>  
> Am I correct?   Again, thanks in advance.

Not quite. If you want to call xlat on an instance of a module the syntax is module:variable

"%{clients_ldap:LDAP-Group}"

Also for assignment

update <attribute list> {
	<attribute> <op> <value>
}

see man unlang for more details

-Arran

Arran Cudbard-Bell
a.cudbardb at freeradius.org

Betelwiki, Betelwiki, Betelwiki.... http://wiki.freeradius.org/ !

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20111013/7c7a7920/attachment.html>


More information about the Freeradius-Users mailing list