Bug #16773 » 16773.patch
| 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)?>&showact=<?=htmlspecialchars($_REQUEST['showact'])?>&act=del&id=<?=htmlspecialchars($cpent[5])?>" usepost><i class="fa-solid fa-trash-can" title="<?=gettext("Disconnect this User")?>"></i></a>
|
||
|
<a href="?zone=<?=urlencode($cpzone)?>&showact=<?=urlencode($_REQUEST['showact'])?>&act=del&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 " ";
|
||
|
endif;
|
||
|
?>
|
||
|
</td>
|
||
|
<td>
|
||
|
<a href="?order=<?=htmlspecialchars($_GET['order']);?>&showact=<?=$showact;?>&act=del&zone=<?=$cpent[10];?>&id=<?=$cpent[5];?>">
|
||
|
<a href="status_captiveportal.php?order=<?=urlencode($_GET['order']);?>&showact=<?=urlencode($showact);?>&act=del&zone=<?=urlencode($cpent[10]);?>&id=<?=urlencode($cpent[5]);?>" usepost>
|
||
|
<i class="fa-solid fa-trash-can" title="<?=gettext("delete");?>"></i>
|
||
|
</a>
|
||
|
</td>
|
||
- « Previous
- 1
- 2
- Next »