[fix] diagnostic:dns custom records

This commit is contained in:
alban 2014-07-06 00:13:29 +02:00
parent 1724255137
commit dedbc14b73
1 changed files with 33 additions and 4 deletions

View File

@ -88,6 +88,10 @@ class Alternc_Diagnostic_Service_Dns
return $res; return $res;
} }
/**
* Lists domains `host $DOMAIN` data
* @return array
*/
function getHosts(){ function getHosts(){
$resultArray = array(); $resultArray = array();
foreach ($this->domainList as $domain => $domainInfo) { foreach ($this->domainList as $domain => $domainInfo) {
@ -100,6 +104,11 @@ class Alternc_Diagnostic_Service_Dns
return $resultArray; return $resultArray;
} }
/**
* Lists domains NS
*
* @return array
*/
function getNameservers(){ function getNameservers(){
$resultArray = array(); $resultArray = array();
foreach ($this->domainList as $domain => $domainInfo) { foreach ($this->domainList as $domain => $domainInfo) {
@ -112,6 +121,11 @@ class Alternc_Diagnostic_Service_Dns
return $resultArray; return $resultArray;
} }
/**
* Lists zones content
*
* @return array
*/
function getZonesList(){ function getZonesList(){
$resultArray = array(); $resultArray = array();
foreach ($this->domainList as $domain => $domainInfo) { foreach ($this->domainList as $domain => $domainInfo) {
@ -124,6 +138,11 @@ class Alternc_Diagnostic_Service_Dns
return $resultArray; return $resultArray;
} }
/**
* Lists which domains zones are locked
*
* @return array
*/
function getZonesLocked(){ function getZonesLocked(){
$resultArray = array(); $resultArray = array();
foreach ($this->domainList as $domain => $domainInfo) { foreach ($this->domainList as $domain => $domainInfo) {
@ -136,14 +155,19 @@ class Alternc_Diagnostic_Service_Dns
return $resultArray; return $resultArray;
} }
/**
* Lists which domains zones have custom records
*
* @return array
*/
function getZonesCustomRecords(){ function getZonesCustomRecords(){
$resultArray = array(); $resultArray = array();
$regexp = ".*;;; END ALTERNC AUTOGENERATE CONFIGURATION.*\w.*"; $regexp = ";;; END ALTERNC AUTOGENERATE CONFIGURATION\n(.+\w+.+)";
foreach ($this->zonesList as $domain => $zone) { foreach ($this->zonesList as $domain => $zone) {
$is_custom = false; $is_custom = false;
try{ try{
if(preg_match("/$regexp/", $zone)){ if(preg_match("/$regexp/ms", $zone, $matches)){
$is_custom = true; $is_custom = $matches[1];
} }
}catch( \Exception $e){ }catch( \Exception $e){
echo $e->getMessage()."\n"; echo $e->getMessage()."\n";
@ -152,7 +176,12 @@ class Alternc_Diagnostic_Service_Dns
} }
return $resultArray; return $resultArray;
} }
/**
* Lists servers DNS slaves accounts
*
* @return array
*/
function getSlaves(){ function getSlaves(){
return $this->dom->enum_slave_account(); return $this->dom->enum_slave_account();
} }