dyndns/rfc2136, ditch get_failover_interface() and return_gateway_groups_array() usage

This commit is contained in:
Ad Schellevis
2019-04-09 15:38:30 +02:00
parent 44fd8073c3
commit 0454288b11
5 changed files with 4 additions and 21 deletions
@@ -182,7 +182,6 @@ function dyndns_configure_do($verbose = false, $int = '')
}
$dyndnscfg = $config['dyndnses']['dyndns'];
$gwgroups = return_gateway_groups_array();
if ($verbose) {
echo 'Configuring dynamic DNS clients...';
@@ -190,7 +189,7 @@ function dyndns_configure_do($verbose = false, $int = '')
}
foreach ($dyndnscfg as $dyndns) {
if ((empty($int)) || ($int == $dyndns['interface']) || (is_array($gwgroups[$dyndns['interface']]))) {
if (empty($int) || $int == $dyndns['interface']) {
$dyndns['verboselog'] = isset($dyndns['verboselog']);
$dyndns['curl_ipresolve_v4'] = isset($dyndns['curl_ipresolve_v4']);
$dyndns['curl_ssl_verifypeer'] = isset($dyndns['curl_ssl_verifypeer']);
@@ -259,13 +259,13 @@ class updatedns
$this->_dnsMX = $dnsMX;
$this->_dnsZoneID = $dnsZoneID;
$this->_dnsTTL = $dnsTTL;
$this->_if = get_failover_interface($dnsIf, $this->_useIPv6 ? 'inet6' : 'all');
$this->_if = get_real_interface($dnsIf, $this->_useIPv6 ? 'inet6' : 'all');
$this->_checkIP();
$this->_dnsUpdateURL = $dnsUpdateURL;
$this->_dnsResultMatch = $dnsResultMatch;
$this->_dnsRequestIf = get_failover_interface($dnsRequestIf, $this->_useIPv6 ? 'inet6' : 'all');
$this->_dnsRequestIf = get_real_interface($dnsRequestIf, $this->_useIPv6 ? 'inet6' : 'all');
if ($this->_dnsVerboseLog) {
log_error("Dynamic DNS ({$this->_dnsHost}): running get_failover_interface for {$dnsRequestIf}. found {$this->_dnsRequestIf}");
log_error("Dynamic DNS ({$this->_dnsHost}): running get_real_interface for {$dnsRequestIf}. found {$this->_dnsRequestIf}");
}
$this->_dnsRequestIfIP = get_interface_ip($dnsRequestIf);
$this->_dnsMaxCacheAgeDays = 25;
@@ -247,7 +247,6 @@ include("head.inc");
<select name="interface" class="selectpicker" id="interface">
<?php
$iflist = get_configured_interface_with_descr();
$iflist = array_merge($iflist, return_gateway_groups_array());
foreach ($iflist as $if => $ifdesc):?>
<option value="<?= $if ?>" <?=$pconfig['interface'] == $if ? 'selected="selected"' : '';?>>
<?= is_array($ifdesc) ? $if : htmlspecialchars($ifdesc) ?>
@@ -264,7 +263,6 @@ include("head.inc");
<select name="requestif" class="selectpicker" id="requestif">
<?php
$iflist = get_configured_interface_with_descr();
$iflist = array_merge($iflist, return_gateway_groups_array());
foreach ($iflist as $if => $ifdesc):?>
<option value="<?= $if ?>" <?= $pconfig['requestif'] == $if ? 'selected="selected"' : '' ?>>
<?= is_array($ifdesc) ? $if : htmlspecialchars($ifdesc) ?>
@@ -98,7 +98,6 @@ if (!empty($_REQUEST['getdyndnsstatus'])) {
<?php
$iflist = get_configured_interface_with_descr();
$types = dyndns_list();
$groupslist = return_gateway_groups_array();
foreach ($a_dyndns as $i => $dyndns) :?>
<tr ondblclick="document.location='services_dyndns_edit.php?id=<?=$i;?>'">
<td style="word-break:break-word;" <?= isset($dyndns['enable']) ? '' : 'class="text-muted"' ?>>
@@ -108,12 +107,6 @@ if (!empty($_REQUEST['getdyndnsstatus'])) {
echo "{$ifdesc}";
break;
}
}
foreach ($groupslist as $if => $group) {
if ($dyndns['interface'] == $if) {
echo "{$if}";
break;
}
}?>
</td>
<td style="word-break:break-word;" <?= isset($dyndns['enable']) ? '' : 'class="text-muted"' ?>>
@@ -104,7 +104,6 @@ if (!empty($_REQUEST['getrfc2136status'])) {
<tbody>
<?php
$iflist = get_configured_interface_with_descr();
$groupslist = return_gateway_groups_array();
foreach ($a_rfc2136 as $i => $rfc2136) :?>
<tr ondblclick="document.location='services_rfc2136_edit.php?id=<?=$i;?>'">
<td style="word-break:break-word;" <?= isset($rfc2136['enable']) ? '' : 'class="text-muted"' ?>>
@@ -114,12 +113,6 @@ if (!empty($_REQUEST['getrfc2136status'])) {
echo "{$ifdesc}";
break;
}
}
foreach ($groupslist as $if => $group) {
if ($rfc2136['interface'] == $if) {
echo "{$if}";
break;
}
}?>
</td>
<td style="word-break:break-word;" <?= isset($rfc2136['enable']) ? '' : 'class="text-muted"' ?>>