well... that is pretty much it...
What Im trying to achieve is:
- When a user logs in, they are always presented with the login page (captive portal is configured to hit guest_register.php)
- To smooth out the login process I would like to recognise the mac address (captured at registration) and forward them to either the login page (if mac is valid) or registration (if mac is null)
The above script is all that was required (minus the "if" statement) and is annotated as below
{nwa_radius_query _method=GetCallingStationSessions callingstationid=$mac mac_format=$mac_format from_time="31556926" assign=session}
nwa_radius_query: Perform a lookup from the radius table on CP
_method=GetCallingStationSessions: Where the column is the MAC addresses recorded
callingstationid=$mac: and the value to look for is in the variable $mac (which is pulled from the url)
from_time="31556926": from the time period of the last year
assign=session: assign a boolean value to the variable $session
This config is valid on 3.9 and is still described in the 6.2 doco, however I may have missed something related to 6.2....