From 6635aa0f6c7a166a56a92ea2492930a67e825ce1 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 1 Feb 2016 12:35:59 -0500 Subject: Change Namecheap dyndns to use split hostname and domain name fields. Upgrade existing entries automatically. Implements #4366 Code should be generic enough that if other DynDNS providers would work better with a separate domain field, they can pick up the feature without too much trouble. --- src/usr/local/www/services_dyndns.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/usr/local/www/services_dyndns.php') diff --git a/src/usr/local/www/services_dyndns.php b/src/usr/local/www/services_dyndns.php index c9f24ff..e095cb2 100644 --- a/src/usr/local/www/services_dyndns.php +++ b/src/usr/local/www/services_dyndns.php @@ -70,7 +70,12 @@ $a_dyndns = &$config['dyndnses']['dyndns']; if ($_GET['act'] == "del") { $conf = $a_dyndns[$_GET['id']]; - @unlink("{$g['conf_path']}/dyndns_{$conf['interface']}{$conf['type']}" . escapeshellarg($conf['host']) . "{$conf['id']}.cache"); + if ($conf['type'] == "namecheap") { + $hostname = $conf['host'] . "." . $conf['domainname']; + } else { + $hostname = $conf['host']; + } + @unlink("{$g['conf_path']}/dyndns_{$conf['interface']}{$conf['type']}" . escapeshellarg($hostname) . "{$conf['id']}.cache"); unset($a_dyndns[$_GET['id']]); write_config(); @@ -124,6 +129,11 @@ display_top_tabs($tab_array); > @@ -162,13 +172,13 @@ foreach ($a_dyndns as $dyndns):