From a75d10d7548e69fb6fd3b9dcf14d357febcc72f4 Mon Sep 17 00:00:00 2001
From: pedro_morgan <pedro_morgan@ispconfig3>
Date: Tue, 21 Aug 2007 19:32:35 -0400
Subject: [PATCH] Removed globals and created private vars

---
 server/mods-enabled/web_module.inc.php |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/server/mods-enabled/web_module.inc.php b/server/mods-enabled/web_module.inc.php
index a32b8b5..5377911 100644
--- a/server/mods-enabled/web_module.inc.php
+++ b/server/mods-enabled/web_module.inc.php
@@ -60,7 +60,10 @@
  		class that contains the function functionname.
 		*/
 		
-		$app->modules->registerTableHook('web_domain','mail_module','process');
+		$app->modules->registerTableHook('web_domain','web_module','process');
+		
+		// Register service
+		$app->services->registerService('httpd','web_module','restartHttpd');
 		
 	}
 	
@@ -80,6 +83,18 @@
 			break;
 		} // end switch
 	} // end function
+	
+	
+	// This function is used
+	function restartHttpd($action = 'restart') {
+		global $app;
+		if($action == 'restart') {
+			exec('/etc/init.d/apache2 restart');
+		} else {
+			exec('/etc/init.d/apache2 reload');
+		}
+		
+	}
 
 } // end class
 

--
Gitblit v1.9.1