From c688fcdbf4c2491dee281edbe267b9e3994e87d5 Mon Sep 17 00:00:00 2001 From: "David P. Discher" Date: Wed, 25 Apr 2018 03:35:57 +0000 Subject: [PATCH] Fix ONA so that a third level dns domain can add a DNS server. --- www/config/config.inc.php | 2 +- www/include/functions_gui.inc.php | 4 ++-- www/modules/ona/dns_record.inc.php | 2 +- www/modules/ona/domain_server.inc.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/www/config/config.inc.php b/www/config/config.inc.php index 47be897a..63750f6e 100644 --- a/www/config/config.inc.php +++ b/www/config/config.inc.php @@ -217,7 +217,7 @@ } // Include functions that replace the default session handler with one that uses MySQL as a backend -require_once($conf['inc_db_sessions']); +// require_once($conf['inc_db_sessions']); // Include the GUI functions require_once($conf['inc_functions_gui']); diff --git a/www/include/functions_gui.inc.php b/www/include/functions_gui.inc.php index cd4f4162..dc4995ec 100644 --- a/www/include/functions_gui.inc.php +++ b/www/include/functions_gui.inc.php @@ -141,7 +141,7 @@ function workspace_plugin_loader($modulename, $record=array(), $extravars=array( global $conf, $self, $base, $images, $color, $style, $onadb; $modhtml = ''; $modjs = ''; - $modwsmenu = ''; + $modwsmenu = array(); $modbodyhtml = ''; $ws_plugin_dir = "{$base}/workspace_plugins"; @@ -350,7 +350,7 @@ function get_host_suggestions($q, $max_results=10) { list($status, $rows, $view) = db_get_record($onadb, 'dns_views', array('id' => $record['dns_view_id'])); $viewname = $view['name'].'/'; } - $results[] = $viewname.$record[$field].".".$domain['name']; + $results[] = $viewname.$record[$field].".".ona_build_domain_name ( $record['domain_id'] ); } } diff --git a/www/modules/ona/dns_record.inc.php b/www/modules/ona/dns_record.inc.php index 7812d15b..8d2dd252 100644 --- a/www/modules/ona/dns_record.inc.php +++ b/www/modules/ona/dns_record.inc.php @@ -951,7 +951,7 @@ function dns_record_modify($options="") { $options['set_name'] = preg_replace("/^\./", '', $options['set_name']); // Find the DNS record from $options['name'] - list($status, $rows, $dns) = ona_find_dns_record($options['name']); + list($status, $rows, $dns) = ona_find_dns_record($options['server'] . "." . $domain['fqdn']); printmsg("DEBUG => dns_record_modify() DNS record: {$dns['fqdn']}", 3); if ($rows > 1) { printmsg("DEBUG => Found more than one DNS record for: {$options['name']}",3); diff --git a/www/modules/ona/domain_server.inc.php b/www/modules/ona/domain_server.inc.php index f187d910..b3e6ddda 100644 --- a/www/modules/ona/domain_server.inc.php +++ b/www/modules/ona/domain_server.inc.php @@ -80,7 +80,7 @@ function domain_server_add($options="") { printmsg("DEBUG => domain_server_add(): Found domain, {$domain['name']}", 3); // Determine the server is valid - list($status, $rows, $ns_dns) = ona_find_dns_record($options['server']); + list($status, $rows, $ns_dns) = ona_find_dns_record($options['server'] . "." . $domain['fqdn']); list($status, $rows, $interface) = ona_find_interface($ns_dns['interface_id']); $host['id'] = $interface['host_id']; @@ -169,7 +169,7 @@ function domain_server_add($options="") { if (!$dnsrows) { printmsg("DEBUG => Auto adding a NS record for {$options['server']}.", 0); // Run dns_record_add as a NS type - list($status, $output) = run_module('dns_record_add', array('name' => $domain['fqdn'],'pointsto' => $options['server'], 'type' => 'NS')); + list($status, $output) = run_module('dns_record_add', array('name' => $domain['fqdn'],'pointsto' => $options['server'] . "." . $domain['fqdn'], 'type' => 'NS')); if ($status) return(array($status, $output)); $add_to_error .= $output;