Skip to content

Commit

Permalink
Merge pull request #320 from doktornotor/patch-11
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgarga committed Mar 7, 2017
2 parents ff243c5 + b96e7f9 commit b0c86cf
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 73 deletions.
2 changes: 1 addition & 1 deletion dns/pfSense-pkg-bind9/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PORTNAME= pfSense-pkg-bind
PORTVERSION= 9.11
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= dns net ipv6
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
8 changes: 1 addition & 7 deletions dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ if (!function_exists("filter_configure")) {
require_once("notices.inc");
require_once("xmlrpc_client.inc");

$pf_version = substr(trim(file_get_contents("/etc/version")), 0, 3);
if ($pf_version == "2.1" || $pf_version == "2.2") {
define('BIND_LOCALBASE', '/usr/pbi/bind-'.php_uname("m"));
} else {
define('BIND_LOCALBASE', '/usr/local');
}

define('BIND_LOCALBASE', '/usr/local');
define('CHROOT_LOCALBASE', '/cf/named');

function bind_zone_validate($post, &$input_errors) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,96 +1,79 @@
<?php
/*
bind.widget.php
part of pfSense (https://www.pfSense.org/)
Copyright 2013 Marcello Coutinho
Copyright (C) 2015 ESF, LLC
All rights reserved.
* bind.widget.php
*
* part of pfSense (https://www.pfsense.org)
* Copyright (c) 2015-2017 Rubicon Communications, LLC (Netgate)
* Copyright (c) 2013 Marcello Coutinho
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
@require_once("guiconfig.inc");
@require_once("pfsense-utils.inc");
@require_once("functions.inc");

$uname = posix_uname();
if ($uname['machine'] == 'amd64') {
ini_set('memory_limit', '250M');
}
require_once("guiconfig.inc");

function open_table() {
echo '<div class="table-responsive">';
// style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0"
echo '<table class="table table-striped table-hover">';
echo '<tbody>';
echo '<tr>';
}

function close_table() {
echo '</tr>';
echo '</tbody>';
echo '</table>';
echo '</div>';
}

$pfb_table = array();
$img['Sick'] = '<img src ="/themes/{' . $g['theme'] . '}/images/icons/icon_interface_down.gif" alt="sick">';
$img['Healthy'] = '<img src ="/themes/{' . $g['theme'] . '}/images/icons/icon_interface_up.gif" alt="healthy">';
?>

<div id="bind"><?php
global $config;
<div id="bind">
<?php
$rndc_bin = "/usr/local/sbin/rndc";

if (file_exists($rndc_bin)) {
if (is_executable($rndc_bin)) {
exec("$rndc_bin -c /cf/named/etc/namedb/rndc.conf status", $status);
}

open_table();
foreach ($status as $line) {
$fields = explode(":", $line);
print '<tr><td class="vncellt"><strong>' . ucfirst($fields[0]) . '</strong></td>';
// print '<tr><td class="vncellt" width=50%><strong>' . ucfirst($fields[0]) . '</strong></td>';
print '<td class="listlr">' . $fields[1] . '</td></tr>';
print '<tr><td><strong>' . ucfirst($fields[0]) . '</strong></td>';
print '<td>' . $fields[1] . '</td></tr>';
}
close_table();
?>
</div>
<script type="text/javascript">
//<![CDATA[
function getstatus_bind() {
var url = "/widgets/widgets/bind.widget.php";
var pars = 'getupdatestatus=yes';
var myAjax = $.ajax({
url: url,
type: "get",
data: pars,
complete: activitycallback_bind
});
}
<script type="text/javascript">
//<![CDATA[
function getstatus_bind() {
var url = "/widgets/widgets/bind.widget.php";
var pars = 'getupdatestatus=yes';
var myAjax = $.ajax({
url: url,
type: "get",
data: pars,
complete: activitycallback_bind
});
}

function activitycallback_bind(transport) {
$('bind').innerHTML = transport.responseText;
setTimeout('getstatus_bind()', 5000);
}
events.push(function(){
getstatus_bind();
});
//]]>
</script>
function activitycallback_bind(transport) {
$('bind').innerHTML = transport.responseText;
setTimeout('getstatus_bind()', 5000);
}
events.push(function(){
getstatus_bind();
});
//]]>
</script>

0 comments on commit b0c86cf

Please sign in to comment.