diff options
-rw-r--r-- | usr/local/captiveportal/radius_authentication.inc | 15 | ||||
-rwxr-xr-x | usr/local/www/services_captiveportal.php | 15 |
2 files changed, 24 insertions, 6 deletions
diff --git a/usr/local/captiveportal/radius_authentication.inc b/usr/local/captiveportal/radius_authentication.inc index bd5b74e..1f7e2b5 100644 --- a/usr/local/captiveportal/radius_authentication.inc +++ b/usr/local/captiveportal/radius_authentication.inc @@ -61,13 +61,16 @@ function RADIUS_AUTHENTICATION($username,$password,$radiusservers,$clientip,$cli switch($radiusvendor) { case 'cisco': - $calledstationid = $clientmac; - $callingstationid = $clientip; - break; - + $calledstationid = $clientmac; + $callingstationid = $clientip; + break; default: - $calledstationid = get_interface_ip($config['captiveportal']['radiussrcip_attribute']); - $callingstationid = $clientmac; + if (is_ipaddr($config['captiveportal']['radiussrcip_attribute'])) + $calledstationid = $config['captiveportal']['radiussrcip_attribute']; + else + $calledstationid = get_interface_ip($config['captiveportal']['radiussrcip_attribute']); + $callingstationid = $clientmac; + break; } // Create our instance diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index c47eba9..0c60c7c 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -544,6 +544,21 @@ value="<?=htmlspecialchars($pconfig['radiuskey2']);?>"></td> echo "<option value='{$ifdesc}' {$selected}>{$ifdescr} - {$ipaddr}</option>\n"; } } + if (is_array($config['virtualip']['vip'])) { + foreach ($config['virtualip']['vip'] as $sn) { + if ($sn['mode'] == "proxyarp" && $sn['type'] == "network") { + $start = ip2long32(gen_subnet($sn['subnet'], $sn['subnet_bits'])); + $end = ip2long32(gen_subnet_max($sn['subnet'], $sn['subnet_bits'])); + $len = $end - $start; + + for ($i = 0; $i <= $len; $i++) { + $snip = long2ip32($start+$i); + echo "<option value='{$snip}' {$selected}>" . htmlspecialchars("{$sn['descr']} - {$snip}") . "></option>\n"; + } + } else + echo "<option value='{$sn['subnet']}' {$selected}>" . htmlspecialchars("{$sn['descr']} - {$sn['subnet']}") . "></option>\n"; + } + } ?> </select><br/> Choose the ip to use for calling station attribute. |