summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-01-12 21:14:06 +0545
committerRenato Botelho <renato@netgate.com>2017-01-13 18:44:52 -0200
commitc8e0a211627d4b13db8e214b54c9179b7f6ce167 (patch)
treec15f417faa8d8fde4193642e5f7b542d108cf3f3
parent4c2976b56e2798d71c2db9c920bf66788fda6619 (diff)
downloadpfsense-c8e0a211627d4b13db8e214b54c9179b7f6ce167.zip
pfsense-c8e0a211627d4b13db8e214b54c9179b7f6ce167.tar.gz
Remove excess loops in DynDNS Widget
(cherry picked from commit b84126b5e74473b1e6a576f38da2149a95ab03fc)
-rw-r--r--src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php b/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
index 099b03c..315edfa 100644
--- a/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
@@ -131,6 +131,9 @@ if ($_REQUEST['getdyndnsstatus']) {
exit;
}
+$iflist = get_configured_interface_with_descr();
+$groupslist = return_gateway_groups_array();
+$dyndns_providers = array_combine(explode(" ", DYNDNS_PROVIDER_VALUES), explode(",", DYNDNS_PROVIDER_DESCRIPTIONS));
?>
<table id="dyn_dns_status" class="table table-striped table-hover">
@@ -157,32 +160,19 @@ if ($_REQUEST['getdyndnsstatus']) {
} ?>
<tr ondblclick="document.location='services_dyndns_edit.php?id=<?=$dyndnsid;?>'"<?=!isset($dyndns['enable'])?' class="disabled"':''?>>
<td>
- <?php $iflist = get_configured_interface_with_descr();
- foreach ($iflist as $if => $ifdesc) {
- if ($dyndns['interface'] == $if) {
- print($ifdesc);
- break;
- }
+ <?php
+ if (isset($iflist[$dyndns['interface']])) {
+ print($iflist[$dyndns['interface']]);
}
- $groupslist = return_gateway_groups_array();
- foreach ($groupslist as $if => $group) {
- if ($dyndns['interface'] == $if) {
- print($if);
- break;
- }
+
+ if (isset($groupslist[$dyndns['interface']])) {
+ print($dyndns['interface']);
}
?>
</td>
<td>
+ <?=htmlspecialchars($dyndns_providers[$dyndns['type']]);?>
<?php
- $types = explode(",", DYNDNS_PROVIDER_DESCRIPTIONS);
- $vals = explode(" ", DYNDNS_PROVIDER_VALUES);
- for ($j = 0; $j < count($vals); $j++) {
- if ($vals[$j] == $dyndns['type']) {
- print(htmlspecialchars($types[$j]));
- break;
- }
- }
if ($dyndns['type'] == '_rfc2136_') : ?>
RFC 2136
<?php endif; ?>
OpenPOWER on IntegriCloud