diff options
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/diag_dns.php | 10 | ||||
-rw-r--r-- | usr/local/www/diag_logs_settings.php | 8 | ||||
-rw-r--r-- | usr/local/www/diag_ping.php | 8 | ||||
-rw-r--r-- | usr/local/www/diag_testport.php | 8 | ||||
-rw-r--r-- | usr/local/www/diag_traceroute.php | 8 | ||||
-rw-r--r-- | usr/local/www/getserviceproviders.php | 2 | ||||
-rwxr-xr-x | usr/local/www/graph.php | 2 | ||||
-rw-r--r-- | usr/local/www/graph_cpu.php | 2 | ||||
-rw-r--r-- | usr/local/www/installer/installer.php | 5 | ||||
-rw-r--r-- | usr/local/www/interfaces.php | 11 | ||||
-rw-r--r-- | usr/local/www/status_dhcp_leases.php | 22 |
11 files changed, 51 insertions, 35 deletions
diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index d99c5ba..cbce9aa 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -38,11 +38,13 @@ require("guiconfig.inc"); $host = trim($_REQUEST['host'], " \t\n\r\0\x0B[];\"'"); $host_esc = escapeshellarg($host); -if (is_array($config['aliases']['alias'])) { - $a_aliases = &$config['aliases']['alias']; -} else { - $a_aliases = array(); +/* If this section of config.xml has not been populated yet we need to set it up +*/ +if (!is_array($config['aliases']['alias'])) { + $config['aliases']['alias'] = array(); } +$a_aliases = &$config['aliases']['alias']; + $aliasname = str_replace(array(".","-"), "_", $host); $alias_exists = false; $counter=0; diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php index e2eca1a..5f48985 100644 --- a/usr/local/www/diag_logs_settings.php +++ b/usr/local/www/diag_logs_settings.php @@ -380,13 +380,13 @@ function check_everything() { <select name="sourceip" class="formselect"> <option value="">Default (any)</option> <?php $sourceips = get_possible_traffic_source_addresses(false); - foreach ($sourceips as $sip): + foreach ($sourceips as $sipvalue => $sipname): $selected = ""; - if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $pconfig['sourceip'])) + if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $pconfig['sourceip'])) $selected = 'selected="selected"'; ?> - <option value="<?=$sip['value'];?>" <?=$selected;?>> - <?=htmlspecialchars($sip['name']);?> + <option value="<?=$sipvalue;?>" <?=$selected;?>> + <?=htmlspecialchars($sipname);?> </option> <?php endforeach; ?> </select> diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php index bc60f71..0c289cf 100644 --- a/usr/local/www/diag_ping.php +++ b/usr/local/www/diag_ping.php @@ -116,13 +116,13 @@ include("head.inc"); ?> <select name="sourceip" class="formselect"> <option value="">Default</option> <?php $sourceips = get_possible_traffic_source_addresses(true); - foreach ($sourceips as $sip): + foreach ($sourceips as $sipvalue => $sipname): $selected = ""; - if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip)) + if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $sourceip)) $selected = "selected=\"selected\""; ?> - <option value="<?=$sip['value'];?>" <?=$selected;?>> - <?=htmlspecialchars($sip['name']);?> + <option value="<?=$sipvalue;?>" <?=$selected;?>> + <?=htmlspecialchars($sipname);?> </option> <?php endforeach; ?> </select> diff --git a/usr/local/www/diag_testport.php b/usr/local/www/diag_testport.php index b64075e..393c757 100644 --- a/usr/local/www/diag_testport.php +++ b/usr/local/www/diag_testport.php @@ -140,13 +140,13 @@ include("head.inc"); ?> <select name="sourceip" class="formselect"> <option value="">Any</option> <?php $sourceips = get_possible_traffic_source_addresses(true); - foreach ($sourceips as $sip): + foreach ($sourceips as $sipvalue => $sipname): $selected = ""; - if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip)) + if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $sourceip)) $selected = "selected=\"selected\""; ?> - <option value="<?=$sip['value'];?>" <?=$selected;?>> - <?=htmlspecialchars($sip['name']);?> + <option value="<?=$sipvalue;?>" <?=$selected;?>> + <?=htmlspecialchars($sipname);?> </option> <?php endforeach; ?> </select> diff --git a/usr/local/www/diag_traceroute.php b/usr/local/www/diag_traceroute.php index 8cdbf93..7878ebe 100644 --- a/usr/local/www/diag_traceroute.php +++ b/usr/local/www/diag_traceroute.php @@ -116,13 +116,13 @@ if (!isset($do_traceroute)) { <select name="sourceip" class="formselect"> <option value="">Any</option> <?php $sourceips = get_possible_traffic_source_addresses(true); - foreach ($sourceips as $sip): + foreach ($sourceips as $sipvalue => $sipname): $selected = ""; - if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip)) + if (!link_interface_to_bridge($sipvalue) && ($sipvalue == $sourceip)) $selected = "selected=\"selected\""; ?> - <option value="<?=$sip['value'];?>" <?=$selected;?>> - <?=htmlspecialchars($sip['name']);?> + <option value="<?=$sipvalue;?>" <?=$selected;?>> + <?=htmlspecialchars($sipname);?> </option> <?php endforeach; ?> </select> diff --git a/usr/local/www/getserviceproviders.php b/usr/local/www/getserviceproviders.php index d720d14..b34e046 100644 --- a/usr/local/www/getserviceproviders.php +++ b/usr/local/www/getserviceproviders.php @@ -76,7 +76,7 @@ function providers_list($country) { function provider_plan_data($country,$provider,$connection) { header("Content-type: application/xml;"); - echo "<?xml version=\"1.0\" ?>\n"; + echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; echo "<connection>\n"; $serviceproviders = get_country_providers($country); foreach($serviceproviders as $sp) { diff --git a/usr/local/www/graph.php b/usr/local/www/graph.php index ce65a55..478bae4 100755 --- a/usr/local/www/graph.php +++ b/usr/local/www/graph.php @@ -102,7 +102,7 @@ if(file_exists("/usr/local/www/themes/{$g['theme']}/graph.php")) { } /********* Graph DATA **************/ -print('<?xml version="1.0" ?>' . "\n");?> +print('<?xml version="1.0" encoding="UTF-8"?>' . "\n");?> <svg width="100%" height="100%" viewBox="0 0 <?=$width?> <?=$height?>" preserveAspectRatio="none" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="init(evt)"> <g id="graph"> <rect id="bg" x1="0" y1="0" width="100%" height="100%" fill="white"/> diff --git a/usr/local/www/graph_cpu.php b/usr/local/www/graph_cpu.php index 200b9ea..ef3f22d 100644 --- a/usr/local/www/graph_cpu.php +++ b/usr/local/www/graph_cpu.php @@ -68,7 +68,7 @@ $height=100; // SVG internal height : do not modify $width=200; // SVG internal width : do not modify /********* Graph DATA **************/ -print('<?xml version="1.0" ?>' . "\n");?> +print('<?xml version="1.0" encoding="UTF-8"?>' . "\n");?> <svg width="100%" height="100%" viewBox="0 0 <?=$width?> <?=$height?>" preserveAspectRatio="none" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="init(evt);"> <g id="graph"> <rect id="bg" x1="0" y1="0" width="100%" height="100%" fill="white"/> diff --git a/usr/local/www/installer/installer.php b/usr/local/www/installer/installer.php index 90c138b..8f5dd91 100644 --- a/usr/local/www/installer/installer.php +++ b/usr/local/www/installer/installer.php @@ -1138,7 +1138,8 @@ EOF; function return_rowhelper_row($rownum, $mountpoint, $fstype, $disk, $size, $encpass) { global $g, $select_txt, $custom_disks, $savemsg; $release = php_uname("r"); - $release = trim($release[0]); + // Get release number like 8.3 or 10.1 + $relnum = strtok($release, "-"); // Mount point $disks = installer_find_all_disks(); @@ -1155,7 +1156,7 @@ function return_rowhelper_row($rownum, $mountpoint, $fstype, $disk, $size, $encp ); // UFS + Journaling was introduced in 9.0 - if($release == "9") { + if($relnum >= 9) { $types['UFS+J'] = "UFS + Journaling"; $types['UFS+J.eli'] = "Encrypted UFS + Journaling"; } diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 8ca3247..62cf658 100644 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -576,6 +576,9 @@ if ($_POST['apply']) { case "dhcp6": if (in_array($wancfg['ipaddrv6'], array())) $input_errors[] = sprintf(gettext("You have to reassign the interface to be able to configure as %s."),$_POST['type6']); + if ($_POST['dhcp6-ia-pd-send-hint'] && strtolower($_POST['dhcp6-ia-pd-len']) == 'none') { + $input_errors[] = gettext('DHCPv6 Prefix Delegation size must be provided when Send IPv6 prefix hint flag is checked'); + } break; case "6rd": foreach ($ifdescrs as $ifent => $ifdescr) { @@ -1154,7 +1157,7 @@ if ($_POST['apply']) { $wancfg['adv_dhcp6_id_assoc_statement_address_enable'] = $_POST['adv_dhcp6_id_assoc_statement_address_enable']; if (!empty($_POST['adv_dhcp6_id_assoc_statement_address'])) $wancfg['adv_dhcp6_id_assoc_statement_address'] = $_POST['adv_dhcp6_id_assoc_statement_address']; - if (!empty($_POST['adv_dhcp6_id_assoc_statement_address_id'])) + if (is_numericint($_POST['adv_dhcp6_id_assoc_statement_address_id'])) $wancfg['adv_dhcp6_id_assoc_statement_address_id'] = $_POST['adv_dhcp6_id_assoc_statement_address_id']; if (!empty($_POST['adv_dhcp6_id_assoc_statement_address_pltime'])) $wancfg['adv_dhcp6_id_assoc_statement_address_pltime'] = $_POST['adv_dhcp6_id_assoc_statement_address_pltime']; @@ -1165,16 +1168,16 @@ if ($_POST['apply']) { $wancfg['adv_dhcp6_id_assoc_statement_prefix_enable'] = $_POST['adv_dhcp6_id_assoc_statement_prefix_enable']; if (!empty($_POST['adv_dhcp6_id_assoc_statement_prefix'])) $wancfg['adv_dhcp6_id_assoc_statement_prefix'] = $_POST['adv_dhcp6_id_assoc_statement_prefix']; - if (!empty($_POST['adv_dhcp6_id_assoc_statement_prefix_id'])) + if (is_numericint($_POST['adv_dhcp6_id_assoc_statement_prefix_id'])) $wancfg['adv_dhcp6_id_assoc_statement_prefix_id'] = $_POST['adv_dhcp6_id_assoc_statement_prefix_id']; if (!empty($_POST['adv_dhcp6_id_assoc_statement_prefix_pltime'])) $wancfg['adv_dhcp6_id_assoc_statement_prefix_pltime'] = $_POST['adv_dhcp6_id_assoc_statement_prefix_pltime']; if (!empty($_POST['adv_dhcp6_id_assoc_statement_prefix_vltime'])) $wancfg['adv_dhcp6_id_assoc_statement_prefix_vltime'] = $_POST['adv_dhcp6_id_assoc_statement_prefix_vltime']; - if (!empty($_POST['adv_dhcp6_prefix_interface_statement_sla_id'])) + if (is_numericint($_POST['adv_dhcp6_prefix_interface_statement_sla_id'])) $wancfg['adv_dhcp6_prefix_interface_statement_sla_id'] = $_POST['adv_dhcp6_prefix_interface_statement_sla_id']; - if (!empty($_POST['adv_dhcp6_prefix_interface_statement_sla_len'])) + if (is_numericint($_POST['adv_dhcp6_prefix_interface_statement_sla_len'])) $wancfg['adv_dhcp6_prefix_interface_statement_sla_len'] = $_POST['adv_dhcp6_prefix_interface_statement_sla_len']; if (!empty($_POST['adv_dhcp6_authentication_statement_authname'])) diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php index 191d9f5..24c41b8 100644 --- a/usr/local/www/status_dhcp_leases.php +++ b/usr/local/www/status_dhcp_leases.php @@ -107,9 +107,12 @@ function adjust_gmt($dt) { } if ($dhcpleaseinlocaltime == "yes") { $ts = strtotime($dt . " GMT"); - return strftime("%Y/%m/%d %I:%M:%S%p", $ts); - } else - return $dt; + if ($ts !== false) { + return strftime("%Y/%m/%d %I:%M:%S%p", $ts); + } + } + /* If we did not need to convert to local time or the conversion failed, just return the input. */ + return $dt; } function remove_duplicate($array, $field) @@ -186,9 +189,16 @@ foreach($leases_content as $lease) { $f = $f+3; break; case "ends": - $leases[$l]['end'] = $data[$f+2]; - $leases[$l]['end'] .= " " . $data[$f+3]; - $f = $f+3; + if ($data[$f+1] == "never") { + // Quote from dhcpd.leases(5) man page: + // If a lease will never expire, date is never instead of an actual date. + $leases[$l]['end'] = gettext("Never"); + $f = $f+1; + } else { + $leases[$l]['end'] = $data[$f+2]; + $leases[$l]['end'] .= " " . $data[$f+3]; + $f = $f+3; + } break; case "tstp": $f = $f+3; |