Patch from Aarno Aukia for cvstrac ticket #1932

This commit is contained in:
Chris Buechler 2009-06-25 02:29:35 -04:00
parent c057951e83
commit 366810dfdd
2 changed files with 16 additions and 4 deletions

View File

@ -925,7 +925,10 @@ EOD;
fclose($fd);
/* generate update instructions */
$upinst = "update delete {$config['dnsupdate']['host']} A\n";
$upinst = "";
if ($config['dnsupdate']['server'])
$upinst .= "server {$config['dnsupdate']['server']}\n";
$upinst .= "update delete {$config['dnsupdate']['host']} A\n";
$upinst .= "update add {$config['dnsupdate']['host']} {$config['dnsupdate']['ttl']} A {$wanip}\n";
$upinst .= "\n"; /* mind that trailing newline! */
@ -1311,4 +1314,4 @@ function upnp_start() {
}
}
?>
?>

View File

@ -45,6 +45,7 @@ $pconfig['wildcard'] = isset($config['dyndns']['wildcard']);
$pconfig['dnsupdate_enable'] = isset($config['dnsupdate']['enable']);
$pconfig['dnsupdate_host'] = $config['dnsupdate']['host'];
$pconfig['dnsupdate_server'] = $config['dnsupdate']['server'];
$pconfig['dnsupdate_ttl'] = $config['dnsupdate']['ttl'];
if (!$pconfig['dnsupdate_ttl'])
$pconfig['dnsupdate_ttl'] = 60;
@ -106,6 +107,7 @@ if ($_POST) {
$config['dnsupdate']['enable'] = $_POST['dnsupdate_enable'] ? true : false;
$config['dnsupdate']['host'] = $_POST['dnsupdate_host'];
$config['dnsupdate']['server'] = $_POST['dnsupdate_server'];
$config['dnsupdate']['ttl'] = $_POST['dnsupdate_ttl'];
$config['dnsupdate']['keyname'] = $_POST['dnsupdate_keyname'];
$config['dnsupdate']['keytype'] = $_POST['dnsupdate_keytype'];
@ -146,6 +148,7 @@ function enable_change(enable_change) {
endis = !(document.iform.dnsupdate_enable.checked || enable_change);
document.iform.dnsupdate_host.disabled = endis;
document.iform.dnsupdate_server.disabled = endis;
document.iform.dnsupdate_ttl.disabled = endis;
document.iform.dnsupdate_keyname.disabled = endis;
document.iform.dnsupdate_keytype[0].disabled = endis;
@ -247,6 +250,12 @@ function enable_change(enable_change) {
<input name="dnsupdate_host" type="text" class="formfld" id="dnsupdate_host" size="30" value="<?=htmlspecialchars($pconfig['dnsupdate_host']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Server</td>
<td width="78%" class="vtable">
<input name="dnsupdate_server" type="text" class="formfld" id="dnsupdate_server" size="30" value="<?=htmlspecialchars($pconfig['dnsupdate_server']);?>">
</td>
</tr>
<tr>
<td valign="top" class="vncellreq">TTL</td>
<td class="vtable">
@ -261,7 +270,7 @@ function enable_change(enable_change) {
This must match the setting on the DNS server.</td>
</tr>
<tr>
<td valign="top" class="vncellreq">Key type </td>
<td valign="top" class="vncell">Key type </td>
<td class="vtable">
<input name="dnsupdate_keytype" type="radio" value="zone" <?php if ($pconfig['dnsupdate_keytype'] == "zone") echo "checked"; ?>> Zone &nbsp;
<input name="dnsupdate_keytype" type="radio" value="host" <?php if ($pconfig['dnsupdate_keytype'] == "host") echo "checked"; ?>> Host &nbsp;
@ -275,7 +284,7 @@ function enable_change(enable_change) {
Paste an HMAC-MD5 key here.</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Protocol</td>
<td width="22%" valign="top" class="vncell">Protocol</td>
<td width="78%" class="vtable">
<input name="dnsupdate_usetcp" type="checkbox" id="dnsupdate_usetcp" value="yes" <?php if ($pconfig['dnsupdate_usetcp']) echo "checked"; ?>>
<strong>Use TCP instead of UDP</strong></td>