freeradius and ADSL-Agent-Circuit-Id

Johan Meiring jmeiring at pcservices.co.za
Wed Jul 21 12:05:40 CEST 2010


On 2010/07/21 11:00 AM, Alan DeKok wrote:
>
> authorize {
> 	...
> 	if (ADSL-Agent-Circuit-Id&&  \
> 		("%{sql: select ...}")) {
> 		update control {
> 			Auth-Type := Accept
> 		}
>
> 	}
> 	else {
> 		reject
> 	}
>
> }
>

I disagree with the logic slightly.
In my opinion it will also be rejected if ADSL-Agent-Circuit-Id does not exist.

As fas as I understand, the desireable result is:
If the ADSL-Agent-Circuit-Id does *not* exist, normal authentication must 
happen.
If it *does* exist, accept or reject, depending on its value.

Would this not work better?

authorize {
	...
	if (ADSL-Agent-Circuit-Id) {
		if ("%{sql: select ...}") {
			update control {
				Auth-Type := Accept
			}
		}
		else {
			reject
		}
	}
}




-- 


Johan Meiring
Cape PC Services CC
Tel: (021) 883-8271
Fax: (021) 886-7782




More information about the Freeradius-Users mailing list