Hi,
In fact my attempt is much simpler as I just have a very simple table containing the mac address of system to accept. My conf looks like that:
authorize {
...
# newer authorized macs
if("%{sql_local:SELECT COUNT(mac) FROM authorized_macs WHERE mac ='%{Calling-Station-ID}'}" > 0){
update control {
Auth-Type := Accept
}
ok = return
}
...
}
But when doing an authentication attemp I get the following in the debug logs :
...
Thu Aug 25 16:52:56 2011 : Info: ++? if (ok) -> FALSE
Thu Aug 25 16:52:56 2011 : Info: ++? if ("%{sql_local:SELECT COUNT(mac) FROM authorized_macs WHERE mac ='%{Calling-Station-ID}'}" > 0)
Thu Aug 25 16:52:56 2011 : Info: WARNING: Unknown module "sql_local" in string expansion "%"
Thu Aug 25 16:52:56 2011 : Info: ? Evaluating ("%{sql_local:SELECT COUNT(mac) FROM authorized_macs WHERE mac ='%{Calling-Station-ID}'}" > 0) -> FALSE
Thu Aug 25 16:52:56 2011 : Info: ++? if ("%{sql_local:SELECT COUNT(mac) FROM authorized_macs WHERE mac ='%{Calling-Station-ID}'}" > 0) -> FALSE
...
Cheers,
seb.