Update ManagementAccess.page

- changes as discussed with @ljm42
This commit is contained in:
Christoph Hummer
2024-03-06 17:50:03 +01:00
committed by GitHub
parent 9d84fedb8e
commit 533a4171bf
+4 -19
View File
@@ -119,8 +119,8 @@ $http_port = _var($var,'PORT','80') != '80' ? ":{$var['PORT']}" : '';
$https_port = _var($var,'PORTSSL','443') != '443' ? ":{$var['PORTSSL']}" : '';
$http_ip_url = "http://"._var($nginx,'NGINX_LANIP')."{$http_port}/";
$https_ip_url = "https://"._var($nginx,'NGINX_LANIP')."{$https_port}/";
$http_ip6_url = "http://"._var($nginx,'NGINX_LANIP6')."{$http_port}/";
$https_ip6_url = "https://"._var($nginx,'NGINX_LANIP6')."{$https_port}/";
$http_ip6_url = "http://["._var($nginx,'NGINX_LANIP6')."]{$http_port}/";
$https_ip6_url = "https://["._var($nginx,'NGINX_LANIP6')."]{$https_port}/";
$http_mdns_url = "http://"._var($nginx,'NGINX_LANMDNS')."{$http_port}/";
$https_mdns_url = "https://"._var($nginx,'NGINX_LANMDNS')."{$https_port}/";
$https_fqdn_url = "https://"._var($nginx,'NGINX_LANFQDN')."{$https_port}/";
@@ -359,25 +359,10 @@ _(Local access URLs)_:
$n = 0;
foreach($urls as $url) {
$msg = "";
if ($var['USE_SSL'] == "no") {
if ($var['PORT'] == 80) {
$url_port = '/';
} else {
$url_port = ':' . $var['PORT'] . '/';
}
} else {
if ($var['PORTSSL'] == "443") {
$url_port = '/';
} else {
$url_port = ':' . $var['PORTSSL'] . '/';
}
}
$url0 = substr_count($url[0]??'',':')>3 ? preg_replace('#(://)([0-9a-fA-F:.]+?)(' . $url_port . ')?$#', '$1[$2]', rtrim($url[0], '/') ?? '') . $url_port : $url[0]; // IPv6 - IPv4 notation
$url1 = substr_count($url[1]??'',':')>3 ? preg_replace('#(://)([0-9a-fA-F:.]+?)(' . $url_port . ')?$#', '$1[$2]', rtrim($url[1], '/') ?? '') . $url_port : $url[1]; // IPv6 - IPv4 notation
if ($url[1]) $msg .= " "._("redirects to")." <a href='$url1'>$url1</a>";
if ($url[1]) $msg .= " "._("redirects to")." <a href='$url[1]'>$url[1]</a>";
if ($url[2]) $msg .= " "._("uses")." ".$url[2];
if ($url[3]) $msg .= "<span class='warning'> <i class='fa fa-warning fa-fw'></i> "._("is a self-signed certificate, ignore the browser's warning and proceed to the GUI")."</span>";
echo ($n ? "<dt>&nbsp;</dt><dd>" : ""),"<a href='$url0'>$url0</a>$msg",($n++ ? "</dd>" : "");
echo ($n ? "<dt>&nbsp;</dt><dd>" : ""),"<a href='$url[0]'>$url[0]</a>$msg",($n++ ? "</dd>" : "");
}?>
:mgmt_local_access_urls_help: