unlang - delete attribute - !*

2013-10-09 Thread Hachmer, Tobias
Hello list,

I want to delete one reply attribute from the reply list if the access-request 
is originating not from a special NAS-IP-Address.

Currently I have solved this by adding this unlang code in authorize section:

if(!NAS-IP-Address == x.x.x.x) {
update reply {
Aruba-Admin-Role := 
}
}

The man page of unlang says:
!* Delete all occurances of the named attribute, no matter what the value.

I think this is the better way than just to clear the attribute value. But how 
can I use this, what's the correct syntax?

I have tested the following without success:

Aruba-Admin-Role !* 
Aruba-Admin-Role !*
!* Aruba-Admin-Role

Thanks in advance,

Tobias Hachmer
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: unlang - delete attribute - !*

2013-10-09 Thread Arran Cudbard-Bell

On 9 Oct 2013, at 07:05, Hachmer, Tobias tobias.hach...@stadt-frankfurt.de 
wrote:

 Hello list,
  
 I want to delete one reply attribute from the reply list if the 
 access-request is originating not from a special NAS-IP-Address.
  
 Currently I have solved this by adding this unlang code in authorize section:
  
 if(!NAS-IP-Address == x.x.x.x) {
 update reply {
 Aruba-Admin-Role := 
 }
 }
  
 The man page of unlang says:
 !* Delete all occurances of the named attribute, no matter what the value.
  
 I think this is the better way than just to clear the attribute value. But 
 how can I use this, what’s the correct syntax?
  
 I have tested the following without success:
  
 Aruba-Admin-Role !* 
 Aruba-Admin-Role !*
 !* Aruba-Admin-Role
  

update reply {
Aruba-Admin-Role !* ANY 
}

Will delete all.

update reply {
Aruba-Admin-Role -= %{reply:Aruba-Admin-Role}
}

Will delete the first instance.

-Arran

Arran Cudbard-Bell a.cudba...@freeradius.org
FreeRADIUS Development Team

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


AW: unlang - delete attribute - !*

2013-10-09 Thread Hachmer, Tobias
Hello Arran,

thanks for the answer. This has worked!

Regards,
Tobias Hachmer


-Ursprüngliche Nachricht-
Von: 
freeradius-users-bounces+tobias.hachmer=stadt-frankfurt...@lists.freeradius.org 
[mailto:freeradius-users-bounces+tobias.hachmer=stadt-frankfurt...@lists.freeradius.org]
 Im Auftrag von Arran Cudbard-Bell
Gesendet: Mittwoch, 9. Oktober 2013 08:22
An: FreeRadius users mailing list
Betreff: Re: unlang - delete attribute - !*


On 9 Oct 2013, at 07:05, Hachmer, Tobias tobias.hach...@stadt-frankfurt.de 
wrote:

 Hello list,
  
 I want to delete one reply attribute from the reply list if the 
 access-request is originating not from a special NAS-IP-Address.
  
 Currently I have solved this by adding this unlang code in authorize section:
  
 if(!NAS-IP-Address == x.x.x.x) {
 update reply {
 Aruba-Admin-Role := 
 }
 }
  
 The man page of unlang says:
 !* Delete all occurances of the named attribute, no matter what the value.
  
 I think this is the better way than just to clear the attribute value. But 
 how can I use this, what's the correct syntax?
  
 I have tested the following without success:
  
 Aruba-Admin-Role !* 
 Aruba-Admin-Role !*
 !* Aruba-Admin-Role
  

update reply {
Aruba-Admin-Role !* ANY
}

Will delete all.

update reply {
Aruba-Admin-Role -= %{reply:Aruba-Admin-Role}
}

Will delete the first instance.

-Arran

Arran Cudbard-Bell a.cudba...@freeradius.org FreeRADIUS Development Team

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html