Make the CP interface check code more buller proof.

This commit is contained in:
Ermal Lui 2009-05-21 23:02:04 +00:00
parent f8b1131038
commit b27f1caf39

View File

@ -57,13 +57,15 @@ function captiveportal_configure() {
foreach ($cpinterfaces as $cpifgrp) {
if (!isset($ifaces[$cpifgrp]))
continue;
if ($firsttime > 0)
$cpinterface .= " or ";
$firsttime = 1;
$tmpif = get_real_interface($cpifgrp);
if (!empty($tmpif)) {
if ($firsttime > 0)
$cpinterface .= " or ";
$cpinterface .= "via {$tmpif}";
$cpips[] = get_interface_ip($cpifgrp);
$firsttime = 1;
$cpipm = get_interface_ip($cpifgrp);
if (is_ipaddr($cpipm))
$cpips[] = $cpipm;
}
}
if (count($cpips) > 0) {