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 ++++++++++++--------------------------------------- 1 file changed, 28 insertions(+), 91 deletions(-) (limited to 'config/bind/bind.inc') 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"; -- cgit v1.2.3