From b349c0bda24c5a0780f650f4e65ee9fce6a4df91 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 17 Aug 2012 11:15:29 -0400
Subject: [PATCH] Removed debug code from remoting.inc.php

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

diff --git a/server/mods-available/dns_module.inc.php b/server/mods-available/dns_module.inc.php
index f079127..01c4526 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,25 +119,25 @@
 	
 	
 	function restartBind($action = 'restart') {
-		global $app;
+		global $app,$conf;
 		
-		$command = '';
-		if(is_file('/etc/init.d/bind9')) {
-			$command = '/etc/init.d/bind9';
+		$daemon = '';
+		if(is_file($conf['init_scripts'] . '/' . 'bind9')) {
+			$daemon = 'bind9';
 		} else {
-			$command = '/etc/init.d/named';
+			$daemon = 'named';
 		}
 		
 		if($action == 'restart') {
-			exec($command.' restart');
+			exec($conf['init_scripts'] . '/' . $daemon . ' restart');
 		} else {
-			exec($command.' reload');
+			exec($conf['init_scripts'] . '/' . $daemon . ' reload');
 		}
 		
 	}
 
 	function restartPowerDNS($action = 'restart') {
-		global $app;
+		global $app,$conf;
 	
 		$app->log("restartPDNS called.",LOGLEVEL_DEBUG);
 
@@ -166,13 +170,14 @@
 */
 		file_put_contents('/etc/powerdns/pdns.d/pdns.ispconfig-axfr',$options."\n");
 
-		if (is_file('/etc/init.d/powerdns')) {
-			$command = '/etc/init.d/powerdns';
+		$daemon= '';
+		if (is_file($conf['init_scripts'] . '/' . 'powerdns')) {
+			$daemon = 'powerdns';
 		} else {
-			$command = '/etc/init.d/pdns';
+			$daemon = 'pdns';
 		}
 
-		exec($command.' restart');
+		exec($conf['init_scripts'] . '/' . $daemon . ' restart');
 
 //     unset $tmps;
 

--
Gitblit v1.9.1