User's Manual

486 | Reference Dell Networking W-ClearPass Guest 6.4 | User Guide
The following parameters control the query to be executed:
l _method (required) – Name of the query function to execute. A brief listing of the available methods is
provided below.
l _arg0, _arg1, …, _argN (optional) – Positional arguments for the query function.
l Named arguments may also be supplied; the arguments must be named identically to the function
arguments listed in the documentation for the query function.
The following parameters control how the result should be processed:
l _assign – Name of a page variable to store the output; if not set, output is sent to the browser as the result
of evaluating the template function.
l _output Index of item to return from the RPC result; if not set, the complete result is returned. This may
be of use when an array containing multiple values is returned and only one of these values is required.
l _default Default value to display or return if an error occurs or the _output field is not available in the
result.
For ease of use, assign” is also supported as a synonym for “_assign.
This template function does not generate any output if the _assign parameter is set.
The methods that are available for use with this function are listed below. The $criteria array consists of one or
more criteria on which to perform a database search. The array is used for advanced cases where pre-defined
helper functions do not provide required flexibility.
ChangeToRole()
ChangeToRole($username, $role_name)
Changes the RADIUS role assigned to the user. If the user currently has active sessions, this function will trigger
an RFC 3576 Change-of-Authorization (CoA) Request to the network access server.
The $username parameter specifies the user account to modify; use the expression GetAttr('User-Name') to
use the value from the RADIUS User-Name attribute.
The $role_name parameter specifies the name of the RADIUS User Role to apply to the user.
Example:
Use the following as a conditional expression for an attribute. If the user's traffic in the past 24 hours exceeds
50 MB, the user is changed to the "Over-Quota" role.
return GetUserTraffic(86400) > 50e6 && ChangeToRole("Over-Quota");
GetCallingStationCurrentSession()
GetCallingStationCurrentSession($callingstationid, $mac_format = null)
Looks up the current (most recent) active session for the specified calling station ID.
Because different NAS equipment can send differently-formatted MAC addresses in the Calling-Station-Id
attribute, the $mac_format argument may be specified. This should be a sprintf-style format string that
accepts 6 arguments (the octets of the MAC address). The default if not specified is the IEEE 802 standard
format, %02X-%02X-%02X-%02X-%02X-%02X – that is, uppercase hexadecimal with each octet separated
with a hyphen.
See "GetCurrentSession()" on page 488 for details of the return value.
GetCallingStationSessions()
GetCallingStationSessions($callingstationid, $from_time, $to_time = null, $mac_format =
null)