486
| Reference
ClearPass Guest 3.9 | Deployment Guide
See
“GetCurrentSession()”
for details of the return value.
GetUserStationCount()
GetUserStationCount($from_time = null, $to_time = null, $exclude_mac = null)
Count the total number of unique MAC addresses used in a time interval, for all sessions with the same
User-Name attribute as that specified in the RADIUS Access-Request.
If
$exclude_mac
is set, any sessions matching that MAC address are excluded from the count.
This function can be used to link a MAC address to a user on the first time they log in, and subsequently
prevent access by the user if using a device other than the original device used.
Examples:
Link the user MAC address on the first time they log in, and prevent all future access unless the calling-
station-id is matched.
return GetUserStationCount() > 0 && AccessReject()
Fail authorization if the user has used more than 1 different MAC address in the past year. (Note: this
does not quite work right as the current session being authorized is not taken into account.)
return GetUserStationCount(365*24*60*60) > 1 && AccessReject()
The correct way to do the above. Checks the last year of accounting records and permits a user a
maximum of 2 different stations.
return GetUserStationCount(365*24*60*60, time(),
GetAttr('calling-station-id')) >= 2 && AccessReject()
GetSessionTimeRemaining()
GetSessionTimeRemaining($username, $format = "relative")
Calculates the session time remaining for a given user account, if the user account was to be authenticated
at the moment of the call.
The $username parameter is required. This is the username for the authentication.
The $format parameter is optional, and defaults to “relative” if not otherwise specified. This parameter may
be one of the following values:
“relative” or “session_time”: Calculates the session timeout as for the Session-Timeout RADIUS
attribute, that is, the number of seconds before the session should end. If the session does not have a
session timeout, the value returned is 0.
“time”: Calculates the session end time, as the UNIX time at which the session should end. If the session
does not have an expiration time, the value returned is 0.
Other values: These are interpreted as a date format (see “NwaDateFormat”) and the session end time is
returned in this format. (Examples: “iso8601”, “longdate”, “recent”, ‘%Y-%m-%d %H:%M’, etc.). If the
session does not have an expiration time, the value returned is a blank string.
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.
Summary of Contents for ClearPass Guest 3.9
Page 1: ...ClearPass Guest 3 9 Deployment Guide ...
Page 32: ...32 Management Overview ClearPass Guest 3 9 Deployment Guide ...
Page 178: ...178 RADIUS Services ClearPass Guest 3 9 Deployment Guide ...
Page 316: ...316 Guest Management ClearPass Guest 3 9 Deployment Guide ...
Page 410: ...410 Administrator Tasks ClearPass Guest 3 9 Deployment Guide ...
Page 414: ...414 Administrator Tasks ClearPass Guest 3 9 Deployment Guide ...
Page 423: ...ClearPass Guest 3 9 Deployment Guide Hotspot Manager 423 ...
Page 440: ...440 High Availability Services ClearPass Guest 3 9 Deployment Guide ...
Page 518: ...518 Index ClearPass Guest 3 9 Deployment Guide ...