From 7d52e00a51450bc4a080d4e21b7dda02c0a65191 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 05:42:06 -0500
Subject: [PATCH] Fixed list sorting

---
 server/mods-available/dns_module.inc.php |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/server/mods-available/dns_module.inc.php b/server/mods-available/dns_module.inc.php
index 4ea5d09..9bab96e 100644
--- a/server/mods-available/dns_module.inc.php
+++ b/server/mods-available/dns_module.inc.php
@@ -47,7 +47,11 @@
 	function onInstall() {
 		global $conf;
 		
-		return true;
+		if($conf['services']['dns'] == true) {
+			return true;
+		} else {
+			return false;
+		}
 		
 	}
 	
@@ -115,7 +119,9 @@
 	
 	
 	function restartBind($action = 'restart') {
-		global $app;
+		global $app,$conf;
+		
+		$app->uses('system');
 		
 		$daemon = '';
 		if(is_file($conf['init_scripts'] . '/' . 'bind9')) {
@@ -124,17 +130,19 @@
 			$daemon = 'named';
 		}
 		
+		$retval = array('output' => '', 'retval' => 0);
 		if($action == 'restart') {
-			exec($conf['init_scripts'] . '/' . $daemon . ' restart');
+			exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']);
 		} else {
-			exec($conf['init_scripts'] . '/' . $daemon . ' reload');
+			exec($app->system->getinitcommand($daemon, 'reload').' 2>&1', $retval['output'], $retval['retval']);
 		}
-		
+		return $retval;
 	}
 
 	function restartPowerDNS($action = 'restart') {
-		global $app;
+		global $app,$conf;
 	
+		$app->uses('system');
 		$app->log("restartPDNS called.",LOGLEVEL_DEBUG);
 
 /**     Since PowerDNS does not currently allow to limit AXFR for specific zones to specific
@@ -166,16 +174,18 @@
 */
 		file_put_contents('/etc/powerdns/pdns.d/pdns.ispconfig-axfr',$options."\n");
 
-		daemon= '';
+		$daemon= '';
 		if (is_file($conf['init_scripts'] . '/' . 'powerdns')) {
 			$daemon = 'powerdns';
 		} else {
 			$daemon = 'pdns';
 		}
 
-		exec($conf['init_scripts'] . '/' . $daemon . ' restart');
+		$retval = array('output' => '', 'retval' => 0);
+		exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']);
 
 //     unset $tmps;
+		return $retval;
 
 	}
 	

--
Gitblit v1.9.1