dotnetrix Posted August 28, 2017 Share Posted August 28, 2017 Hi, I am pulling the following results from a hookpoint: hook file returns: return array("getDNSrecords" => $getDNSrecords); var_dump shows: array(2) { ["metadata"]=> array(4) { ["result"]=> int(1) ["version"]=> int(1) ["command"]=> string( "dumpzone" ["reason"]=> string(15) "Zone Serialized" } ["data"]=> array(1) { ["zone"]=> array(1) { [0]=> array(1) { ["record"]=> array(18) { [0]=> array(4) { ["raw"]=> string(148) "; cPanel first:11.66.0.13 (update_time):1503177319 11.66.0.13: Cpanel::ZoneFile::VERSION:1.3 hostname:central.sometest.om latest:11.66.0.13" ["ttl"]=> string(5) "86400" ["Line"]=> int(1) ["type"]=> string(4) ":RAW" } [1]=> array(4) { ["ttl"]=> string(5) "86400" ["Line"]=> int(2) ["raw"]=> string(37) "; Zone file for sometest.com" ["type"]=> string(4) ":RAW" } [2]=> array(3) { ["type"]=> string(4) "$TTL" ["ttl"]=> string(5) "14400" ["Line"]=> int(3) } [3]=> array(13) { ["minimum"]=> string(5) "86400" ["expire"]=> string(7) "1209600" ["type"]=> string(3) "SOA" ["ttl"]=> string(5) "86400" ["name"]=> string(22) "sometest.com." ["Lines"]=> int(6) ["class"]=> string(2) "IN" ["retry"]=> string(4) "7200" ["serial"]=> string(10) "2017081901" ["Line"]=> int(4) ["mname"]=> string(22) "ns.nameserver1.com" ["refresh"]=> string(4) "3600" ["rname"]=> string(33) "root.central.sometest.com" } [4]=> array(4) { ["Line"]=> int(10) ["ttl"]=> string(5) "86400" ["raw"]=> string(0) "" ["type"]=> string(4) ":RAW" } [5]=> array(6) { ["type"]=> string(2) "NS" ["nsdname"]=> string(22) "ns.nameserver1.com" ["class"]=> string(2) "IN" ["name"]=> string(22) "sometest.com." ["Line"]=> int(11) ["ttl"]=> string(5) "86400" } [6]=> array(6) { ["name"]=> string(22) "sometest.com." ["ttl"]=> string(5) "86400" ["Line"]=> int(12) ["class"]=> string(2) "IN" ["nsdname"]=> string(22) "ns.nameserver2.com" ["type"]=> string(2) "NS" } [7]=> array(6) { ["class"]=> string(2) "IN" ["nsdname"]=> string(22) "ns.nameserver3.com" ["ttl"]=> string(5) "86400" ["Line"]=> int(13) ["name"]=> string(22) "sometest.com." ["type"]=> string(2) "NS" } [8]=> array(6) { ["nsdname"]=> string(22) "ns.nameserver4.com" ["class"]=> string(2) "IN" ["name"]=> string(22) "sometest.com." ["ttl"]=> string(5) "86400" ["Line"]=> int(14) ["type"]=> string(2) "NS" } [9]=> array(4) { ["type"]=> string(4) ":RAW" ["ttl"]=> string(5) "86400" ["Line"]=> int(15) ["raw"]=> string(0) "" } [10]=> array(4) { ["type"]=> string(4) ":RAW" ["ttl"]=> string(5) "86400" ["Line"]=> int(16) ["raw"]=> string(0) "" } [11]=> array(6) { ["class"]=> string(2) "IN" ["ttl"]=> string(5) "14400" ["Line"]=> int(17) ["name"]=> string(22) "sometest.com." ["type"]=> string(1) "A" ["address"]=> string(14) "197.1.1.1" } [12]=> array(4) { ["ttl"]=> string(5) "86400" ["Line"]=> int(18) ["raw"]=> string(0) "" ["type"]=> string(4) ":RAW" } [13]=> array(7) { ["exchange"]=> string(21) "sometest.com" ["class"]=> string(2) "IN" ["ttl"]=> string(5) "14400" ["Line"]=> int(19) ["name"]=> string(22) "sometest.com." ["type"]=> string(2) "MX" ["preference"]=> string(1) "0" } [14]=> array(4) { ["ttl"]=> string(5) "86400" ["Line"]=> int(20) ["raw"]=> string(0) "" ["type"]=> string(4) ":RAW" } [15]=> array(6) { ["class"]=> string(2) "IN" ["ttl"]=> string(5) "14400" ["Line"]=> int(21) ["cname"]=> string(21) "sometest.com" ["name"]=> string(27) "mail.sometest.com." ["type"]=> string(5) "CNAME" } [16]=> array(6) { ["name"]=> string(26) "www.sometest.com." ["cname"]=> string(21) "sometest.com" ["ttl"]=> string(5) "14400" ["Line"]=> int(22) ["class"]=> string(2) "IN" ["type"]=> string(5) "CNAME" } [17]=> array(6) { ["cname"]=> string(21) "sometest.com" ["name"]=> string(26) "ftp.sometest.com." ["ttl"]=> string(5) "14400" ["Line"]=> int(23) ["class"]=> string(2) "IN" ["type"]=> string(5) "CNAME" } } } } } } In the .tpl file I am trying to print the dns zone file into a table, but nothing shows: {foreach item=records from=$getDNSrecords} <b>{$records.data.zone.record}</b> {/foreach} Any help much appreciated. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.