From 6aea580bbd10faf6e19678de42f800f060c316c4 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Thu, 10 Oct 2013 19:21:28 -0300 Subject: bind - remove unused functions and change config result file --- config/bind/bind.inc | 119 +++++++++++---------------------------------- config/bind/bind_views.xml | 7 --- config/bind/bind_zones.xml | 60 ++++------------------- 3 files changed, 38 insertions(+), 148 deletions(-) (limited to 'config/bind') diff --git a/config/bind/bind.inc b/config/bind/bind.inc index 4e01214a..1f7f9d8b 100644 --- a/config/bind/bind.inc +++ b/config/bind/bind.inc @@ -3,7 +3,8 @@ /* bind.inc part of the Bind package for pfSense - Copyright (C) 2013 Juliano Oliveira/Adriano Brancher + Copyright (C) 2013 Juliano Oliveira/Adriano Brancher + Copyright (C) 2013 Marcello Coutinho All rights reserved. Redistribution and use in source and binary forms, with or without @@ -59,8 +60,6 @@ define('CHROOT_LOCALBASE','/conf/named'); $bind_notify = $bind['bind_notify']; $custom_options = base64_decode($bind['bind_custom_options']); $bind_logging = $bind['bind_logging']; - - $bind_conf ="#Bind pfsense configuration\n"; $bind_conf .="#Do not edit this file!!!\n"; $bind_conf .= <<"any","description"=>"Default Access list","row" => array("value"=> "","description"=>"")); + write_config(); + } + $bindacls = $config["installedpackages"]["bindacls"]["config"]; for ($i=0; $ion_type_zone_changed()\n"); } -# Carregar o campo com os dados da views -# ----------------------------------------------------------------------------- - -function get_bind_conf_items_list($data_group, $fieldname) { - global $config; - $res = ''; - if (is_array($config["installedpackages"][$data_group])){ - $conf = $config["installedpackages"][$data_group]["config"]; - if (is_array($conf)) - foreach($conf as $cf) $res[] = $cf[$fieldname]; - } - return $res; -} - -# Carregar o campo com os dados da views -# ----------------------------------------------------------------------------- - -function bind_views_before_form_dest($pkg,$data_group,$fieldname,$dest) { - - $destination_items = get_bind_conf_items_list($data_group,$fieldname); - $i=0; - if (is_array($pkg['fields']['field'])) - foreach($pkg['fields']['field'] as $field) { - # - if ($field['fieldname'] == $dest) { - $fld = &$pkg['fields']['field'][$i]; - if (is_array($destination_items)) - foreach($destination_items as $nmkey => $nm) - $fld['options']['option'][] = array('name'=>ucfirst(strtolower($nm)), 'value'=>strtolower($nm)); - } - $i++; - } -} - -# check zone serial number -# ----------------------------------------------------------------------------- - -function get_bind_conf_serial($data_group, $fieldname) { - global $config; - $res = ''; - if (is_array($config["installedpackages"][$data_group])){ - $conf = $config["installedpackages"][$data_group]["config"]; - if (is_array($conf)) - foreach($conf as $cf) $res[] = $cf[$fieldname]; - } - return $res; -} - -# load data into fields -# ----------------------------------------------------------------------------- - -function bind_zone_before_form_dest($pkg,$data_group,$fieldname,$dest) { - - $destination_items = get_bind_conf_serial($data_group,$fieldname); - $i=0; - if (is_array($pkg['fields']['field'])) - foreach($pkg['fields']['field'] as $field) { - # - if ($field['fieldname'] == $dest) { - $fld = &$pkg['fields']['field'][$i]; - $fld['default_value'] = date("YmdHis"); - #$fld['value'] = date("Ymdhms")."boa"; - } - $i++; - } -} function bind_write_rcfile() { $rc = array(); $BIND_LOCALBASE = "/usr/local"; diff --git a/config/bind/bind_views.xml b/config/bind/bind_views.xml index 2ff19c85..2d620e0c 100644 --- a/config/bind/bind_views.xml +++ b/config/bind/bind_views.xml @@ -50,7 +50,6 @@ 0.1.0 Bind: Views Settings /usr/local/pkg/bind.inc - Bind Server @@ -80,8 +79,6 @@ /pkg_edit.php?xml=bind_sync.xml - ['installedpackages']['bindviews']['config'] @@ -94,8 +91,6 @@ on - View Name @@ -157,8 +152,6 @@ - bind_views_before_form_dest(&$pkg,"bindacls","name","match-clients"); - bind_views_before_form_dest(&$pkg,"bindacls","name","allow-recursion"); diff --git a/config/bind/bind_zones.xml b/config/bind/bind_zones.xml index bef8781b..810fef89 100644 --- a/config/bind/bind_zones.xml +++ b/config/bind/bind_zones.xml @@ -50,7 +50,6 @@ none Bind: Zones Settings /usr/local/pkg/bind.inc - Bind Server @@ -80,8 +79,6 @@ /pkg_edit.php?xml=bind_sync.xml - ['installedpackages']['bindzone']['config'] @@ -102,8 +99,6 @@ on - listtopic @@ -298,46 +293,16 @@ Select Type Host select - - - - - - - - - - + + + + + + + + + + @@ -364,11 +329,6 @@ bind_print_javascript_type_zone(); - bind_views_before_form_dest(&$pkg,"bindacls","name","allowtransfer"); - bind_views_before_form_dest(&$pkg,"bindacls","name","allowquery"); - bind_views_before_form_dest(&$pkg,"bindacls","name","allowupdate"); - bind_views_before_form_dest(&$pkg,"bindviews","name","view"); - bind_zone_before_form_dest(&$pkg,"bindzone","name","serial"); $_POST['serial']=(date("U")+ 1000000000); -- cgit v1.2.3