Project

General

Profile

Bug #16773 » 16773.patch

Jim Pingle, 04/07/2026 06:26 PM

View differences:

src/etc/inc/captiveportal.inc
$listenporthttp = $cpcfg['listenporthttp'] ? $cpcfg['listenporthttp'] : ($cpcfg['zoneid'] + 8000);
$ifip = portal_ip_from_client_ip($cliip);
if (!$ifip) {
$ourhostname = config_get_path('system/hostname') . config_get_path('system/domain');
$ourhostname = config_get_path('system/hostname') . '.' . config_get_path('system/domain');
} else {
$ourhostname = (is_ipaddrv6($ifip)) ? "[{$ifip}]" : "{$ifip}";
}
src/usr/local/captiveportal/index.php
}
} elseif ($_POST['accept'] || $cpcfg['auth_method'] === 'radmac') {
if ($cpcfg['auth_method'] === 'radmac' && !isset($_POST['accept'])) {
$user = $clientmac;
$passwd = $cpcfg['radmac_secret'];
$context = 'radmac'; // Radius MAC authentication
} elseif (!empty(trim($_POST['auth_user2']))) {
$user = trim($_POST['auth_user2']);
$passwd = $_POST['auth_pass2'];
$context = 'second'; // Assume users to use the first context if auth_user2 is empty/does not exist
} else {
$user = trim($_POST['auth_user']);
$passwd = $_POST['auth_pass'];
$context = 'first';
}
if ($cpcfg['auth_method'] == 'none') {
$user = '';
$passwd = '';
$context = 'none';
} elseif ($cpcfg['auth_method'] === 'radmac' && !isset($_POST['accept'])) {
$user = $clientmac;
$passwd = $cpcfg['radmac_secret'];
$context = 'radmac'; // Radius MAC authentication
} elseif (!empty(trim($_POST['auth_user2']))) {
$user = trim($_POST['auth_user2']);
$passwd = $_POST['auth_pass2'];
$context = 'second'; // Assume users to use the first context if auth_user2 is empty/does not exist
} else {
$user = trim($_POST['auth_user']);
$passwd = $_POST['auth_pass'];
$context = 'first';
}
$pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, true);
/* if the pool is empty, return appropriate message and exit */
if (is_null($pipeno)) {
src/usr/local/www/status_captiveportal.php
endif;
?>
<td>
<a href="?zone=<?=htmlspecialchars($cpzone)?>&amp;showact=<?=htmlspecialchars($_REQUEST['showact'])?>&amp;act=del&amp;id=<?=htmlspecialchars($cpent[5])?>" usepost><i class="fa-solid fa-trash-can" title="<?=gettext("Disconnect this User")?>"></i></a>
<a href="?zone=<?=urlencode($cpzone)?>&amp;showact=<?=urlencode($_REQUEST['showact'])?>&amp;act=del&amp;id=<?=urlencode($cpent[5])?>" usepost><i class="fa-solid fa-trash-can" title="<?=gettext("Disconnect this User")?>"></i></a>
</td>
</tr>
<?php
src/usr/local/www/widgets/widgets/captive_portal_status.widget.php
require_once("functions.inc");
require_once("captiveportal.inc");
$cpzone = $_GET['zone'];
if (isset($_POST['zone'])) {
$cpzone = $_POST['zone'];
}
$cpzone = strtolower($cpzone);
if (isset($cpzone) && !empty($cpzone)) {
$cpzoneid = config_get_path("captiveportal/{$cpzone}/zoneid");
}
if (($_GET['act'] == "del") && !empty($cpzone) && isset($cpzoneid)) {
captiveportal_disconnect_client($_GET['id'], 6);
}
unset($cpzone);
flush();
if (!function_exists('clientcmp')) {
......
<tbody>
<?php foreach ($cpdb_all as $cpent): ?>
<tr>
<td><?=$cpent[2];?></td>
<td><?=$cpent[3];?></td>
<td><?=$cpent[4];?></td>
<td><?=date("m/d/Y H:i:s", $cpent[0]);?></td>
<td><?=htmlspecialchars($cpent[2]);?></td>
<td><?=htmlspecialchars($cpent[3]);?></td>
<td><?=htmlspecialchars($cpent[4]);?></td>
<td><?=htmlspecialchars(date("m/d/Y H:i:s", $cpent[0]));?></td>
<td>
<?php
if ($cpent[11] && ($cpent[11] > 0)):
echo date("m/d/Y H:i:s", $cpent[11]);
echo htmlspecialchars(date("m/d/Y H:i:s", $cpent[11]));
else:
echo "&nbsp;";
endif;
?>
</td>
<td>
<a href="?order=<?=htmlspecialchars($_GET['order']);?>&amp;showact=<?=$showact;?>&amp;act=del&amp;zone=<?=$cpent[10];?>&amp;id=<?=$cpent[5];?>">
<a href="status_captiveportal.php?order=<?=urlencode($_GET['order']);?>&amp;showact=<?=urlencode($showact);?>&amp;act=del&amp;zone=<?=urlencode($cpent[10]);?>&amp;id=<?=urlencode($cpent[5]);?>" usepost>
<i class="fa-solid fa-trash-can" title="<?=gettext("delete");?>"></i>
</a>
</td>
(2-2/2)