From ad444849c2cee5341265af2f8e50ef334f6bca0b Mon Sep 17 00:00:00 2001 From: alban Date: Wed, 2 Jul 2014 22:51:01 +0200 Subject: [PATCH] [fix] work with 1.x --- lib/Alternc/Diagnostic/Service/Dns.php | 10 +++++++--- src/diagnostic.php | 12 ++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/Alternc/Diagnostic/Service/Dns.php b/lib/Alternc/Diagnostic/Service/Dns.php index 3b2efd16..ba2bc4f1 100644 --- a/lib/Alternc/Diagnostic/Service/Dns.php +++ b/lib/Alternc/Diagnostic/Service/Dns.php @@ -32,8 +32,12 @@ class Alternc_Diagnostic_Service_Dns /** @var m_dom */ global $dom; - - $this->domainList = $dom->get_domain_all_summary(); + + if( !is_a($dom, "system_bind")){ + + $this->data->setMetadata("Alternc 1.x: can't read DNS"); + return $this->data; + } // Writes the domains list $this->writeSectionData (self::SECTION_LIST,$this->domainList); @@ -108,4 +112,4 @@ class Alternc_Diagnostic_Service_Dns return $this->dom->enum_slave_account(); } -} \ No newline at end of file +} diff --git a/src/diagnostic.php b/src/diagnostic.php index ac96fcf3..89806d27 100644 --- a/src/diagnostic.php +++ b/src/diagnostic.php @@ -91,7 +91,7 @@ function __autoload($class_name) } else { $file_name = $class_name . '.php'; } - + // Attempts to find file in namespace foreach($srcPathList as $namespace => $path ){ $file_path = $path.DIRECTORY_SEPARATOR.$file_name; @@ -112,7 +112,15 @@ function __autoload($class_name) // ================================================================== // ================================================================== -require_once("/usr/share/alternc/panel/class/config_nochk.php"); +// alternc 1.0 +if(is_file("/usr/share/alternc/panel/class/config_nochk.php")){ + require_once("/usr/share/alternc/panel/class/config_nochk.php"); + +}else{ + require_once("/var/alternc/bureau/class/config_nochk.php"); + include "../bureau/class/class_system_bind.php"; +} +