Also fix new index.php and zones.php ...

This commit is contained in:
Mark Schouten 2014-06-10 11:27:12 +02:00
parent f7cb6a803c
commit f8e7493925
2 changed files with 33 additions and 6 deletions

View file

@ -100,6 +100,8 @@ if (isset($templatelist)) {
?>
<body>
<div id="wrap">
<div id="dnssecinfo">
</div>
<div id="menu" class="jtable-main-container">
<div class="jtable-title">
<div class="jtable-title-text">
@ -306,7 +308,30 @@ $(document).ready(function () {
dnssec: {
title: 'DNSSEC',
display: function (zone) {
console.log(zone);
if (zone.record.dnssec == true) {
var $img = $('<img class="list" src="img/lock.png" title="DNSSec Info" />');
$img.click(function () {
$("#dnssecinfo").html("");
$.each(zone.record.keyinfo, function ( i, val) {
if (val.dstxt) {
$("#dnssecinfo").append("<p><h2>"+val.keytype+"</h2><pre>"+val.dstxt+"</pre></p>");
}
});
$("#dnssecinfo").dialog({
modal: true,
title: "DS-records for "+zone.record.name,
width: 'auto',
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
});
return $img;
} else {
return '<img src="img/lock_open.png" title="DNSSec Disabled" />';
}
}
},
<? if (is_adminuser()) { ?>

View file

@ -133,10 +133,12 @@ function get_zone_keys($zone) {
if (!isset($key['active']))
continue;
if (isset($key['dses'])) {
$key['dstxt'] = join("\n", $key['dses']);
if (isset($key['ds'])) {
foreach ($key['ds'] as $ds) {
$key['dstxt'] .= $zone.' IN DS '.$ds."\n";
}
unset($key['dses']);
}
unset($key['ds']);
$ret[] = $key;
}
@ -173,8 +175,8 @@ if ($action == "list" or $action== "listslaves") {
if ($action == "listslaves" and $zone['kind'] == "Slave") {
array_push($return, $zone);
} elseif ($action == "list" and $zone['kind'] != "Slave") {
if ($zone['dnssec'] === TRUE) {
$zone['keyinfo'] = get_zone_keys($zone);
if ($zone['dnssec'] == true) {
$zone['keyinfo'] = get_zone_keys($zone['name']);
}
array_push($return, $zone);
}