From 2d2fd172e1548dd24e1719accd0b856cff6a31a0 Mon Sep 17 00:00:00 2001 From: Falko Timme <ft@falkotimme.com> Date: Fri, 18 Oct 2013 12:20:13 -0400 Subject: [PATCH] - Added funtion to convert currency formatted numbers back to floating numbers. - Improved getSearchSQL() function so that users can use their native date format so search for dates in lists. --- server/plugins-available/bind_plugin.inc.php | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/server/plugins-available/bind_plugin.inc.php b/server/plugins-available/bind_plugin.inc.php index 281e651..fd7f516 100644 --- a/server/plugins-available/bind_plugin.inc.php +++ b/server/plugins-available/bind_plugin.inc.php @@ -39,7 +39,7 @@ function onInstall() { global $conf; - if(isset($conf['bind']['installed']) && $conf['bind']['installed'] == true) { + if(isset($conf['bind']['installed']) && $conf['bind']['installed'] == true && @is_link('/usr/local/ispconfig/server/mods-enabled/dns_module.inc.php')) { return true; } else { return false; @@ -103,6 +103,11 @@ $tpl->setVar($zone); $records = $app->db->queryAllRecords("SELECT * FROM dns_rr WHERE zone = ".$zone['id']." AND active = 'Y'"); + if(is_array($records) && !empty($records)){ + for($i=0;$i<sizeof($records);$i++){ + if($records[$i]['ttl'] == 0) $records[$i]['ttl'] = ''; + } + } $tpl->setLoop('zones',$records); //TODO : change this when distribution information has been integrated into server record @@ -141,10 +146,10 @@ if($data['old']['origin'] != $data['new']['origin']) { //TODO : change this when distribution information has been integrated into server record if (file_exists('/etc/gentoo-release')) { - $filename = $dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($zone['origin'],0,-1)); + $filename = $dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($data['old']['origin'],0,-1)); } else { - $filename = $dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($zone['origin'],0,-1)); + $filename = $dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($data['old']['origin'],0,-1)); } if(is_file($filename)) unlink($filename); @@ -305,7 +310,7 @@ global $app, $conf; //* Only write the master file for the current server - $tmps = $app->db->queryAllRecords("SELECT origin, xfer, also_notify FROM dns_soa WHERE active = 'Y' AND server_id=".$conf["server_id"]); + $tmps = $app->db->queryAllRecords("SELECT origin, xfer, also_notify, update_acl FROM dns_soa WHERE active = 'Y' AND server_id=".$conf["server_id"]); $zones = array(); //* Check if the current zone that triggered this function has at least one NS record @@ -341,6 +346,7 @@ $options .= " allow-transfer {none;};\n"; } if(trim($tmp['also_notify']) != '') $options .= ' also-notify {'.str_replace(',',';',$tmp['also_notify']).";};\n"; + if(trim($tmp['update_acl']) != '') $options .= " allow-update {".str_replace(',',';',$tmp['update_acl']).";};\n"; if(file_exists($zone_file)) { $zones[] = array( 'zone' => substr($tmp['origin'],0,-1), -- Gitblit v1.9.1