Deployment Guide

Table Of Contents
// default authenticated role of the VNS that the
// user is logging into.
// For purposes of this example, assume all
// authenticated users get the 'Guest_Access' role.
return "Guest_Access";
}
}
/**
* A function that decides whether
* to use HTTP or HTTPS in the redirect to
* the controller. This example just uses
* a php.ini user configuration variable
* to decide.
*/
function isHttps() {
if (get_cfg_var('use_https')) {
if (1 == get_cfg_var('use_https')) {
$useHttps = true;
} else {
$useHttps = false;
}
} else {
$useHttps = false;
}
return $useHttps;
}
/**
* A method that assembles an unsigned URL out of the
* the input from the user's succesful login
* @param string $hwc_ip IP or FQDN of controller
* @param int $hwc_port Port on controller to receive redirection
* @param bool $useHttps Whether the redirect uses HTTP or HTTPS
* @param string $token Identifier for the station's session
* @param string $username The name the station's user logged in with
* @param int $wlanid Identifier for the WLAN the station is using
* @param string $assigned_role Name of the access control role to assign
* @param string $dest The URL the station was trying to get to
* @param int $max_duration The maximum length of the station's session.
*/
function makeUnsignedUrl($hwc_ip, $hwc_port, $useHttps, $token,
$username, $wlanid, $assigned_role, $dest,
$max_duration) {
$redirectUrl = ($useHttps ? EWC_HTTPS_REQ : EWC_HTTP_REQ)
.$hwc_ip;
if ((80 != $hwc_port) && (443 != $hwc_port)) {
$redirectUrl .= ":".$hwc_port;
}
$redirectUrl .= EWC_REDIRECT_TARGET
.'token='. rawurlencode($token)
.'&wlan='.rawurlencode($wlanid)
.'&username='.rawurlencode($username)
.(is_not_empty($dest) ?'&dest='.rawurlencode($dest):'')
.(is_not_empty($assigned_role) ? '&role='.
rawurlencode($assigned_role):'')
.(is_not_empty($max_duration) ?'&opt27='.$max_duration:'');
return $redirectUrl;
}
?>
common_utilities.php
<?php
// A library of utilities that can be used by PHP scripts
PHP External Captive Portal, Controller’s Firewall
Friendly API common_utilities.php
Extreme Campus Controller Deployment Guide for version 5.46.03 203