diff options
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/captiveportal/index.php | 9 | ||||
-rwxr-xr-x | usr/local/www/services_captiveportal.php | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 3048b67..82514d8 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -59,14 +59,17 @@ if (!$clientip) { exit; } +$listenporthttps = $cpcfg['listenporthttps'] ? $cpcfg['listenporthttps'] : ($cpcfg['zoneid'] + 1); +$listenporthttp = $cpcfg['listenporthttp'] ? $cpcfg['listenporthttp'] : $cpcfg['zoneid']; + if (isset($config['captiveportal'][$cpzone]['httpslogin'])) - $ourhostname = $config['captiveportal'][$cpzone]['httpsname'] . ":" . ($cpcfg['zoneid'] + 1); + $ourhostname = $config['captiveportal'][$cpzone]['httpsname'] . ":" . $listenporthttps; else { $ifip = portal_ip_from_client_ip($clientip); if (!$ifip) - $ourhostname = $config['system']['hostname'] . $config['system']['domain'] . ":{$cpcfg['zoneid']}"; + $ourhostname = $config['system']['hostname'] . $config['system']['domain'] . ":{$listenporthttp}"; else - $ourhostname = "{$ifip}:{$cpcfg['zoneid']}"; + $ourhostname = "{$ifip}:{$listenporthttp}"; } if ($orig_host != $ourhostname) { diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index 6ee3da4..9a128a7 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -896,10 +896,13 @@ function enable_change(enable_change) { <?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld file" id="htmlfile"><br> <?php list($host) = explode(":", $_SERVER['HTTP_HOST']); - if($pconfig['zoneid']) { - $href = "https://{$host}:{$pconfig['zoneid']}"; + $zoneid = $pconfig['zoneid'] ? $pconfig['zoneid'] : 8000; + if (isset($pconfig['httpslogin'])) { + $port = $pconfig['listenporthttps'] ? $pconfig['listenporthttps'] : ($zoneid + 1); + $href = "https://{$host}:{$port}"; } else { - $href = "http://{$host}:8000"; + $port = $pconfig['listenporthttp'] ? $pconfig['listenporthttp'] : $zoneid; + $href = "http://{$host}:{$port}"; } ?> <?php if ($pconfig['page']['htmltext']): ?> |