ulang AND / OR Condition

Alan DeKok aland at deployingradius.com
Sat Apr 10 16:53:20 CEST 2010


Neville wrote:
> Can I do something like
> 
> if(NAS-IP-Address == 1.1.1.10 OR 1.1.1.20 OR 1.1.1.30 AND SQL-GROUP ==
> "GROUP1"){
> ok
> } else {
>     reject
> }
> 
> Or is there a better way of doing this?


	if ((NAS-IP-Address =~ /^1\.1\.1\.(10|20|30)/) && (SQL-Group...

  Or

	if (((NAS-IP-Address == 1.1.1.10) || \
	     (NAS-IP-Address == 1.1.1.20) || \
	     (NAS-IP-Address == 1.1.1.30)) && \
	    (SQL-Group == "GROUP1")) {
		...

  Alan DeKok.



More information about the Freeradius-Users mailing list