From 1d8123a2b8ed10355ccf09759d6c1cc445312884 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 28 Oct 2009 08:32:29 -0400
Subject: [PATCH] Fixed some bugs in apps_vhost_plugin.

---
 server/plugins-available/apps_vhost_plugin.inc.php |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/server/plugins-available/apps_vhost_plugin.inc.php b/server/plugins-available/apps_vhost_plugin.inc.php
index b16778b..6d93dc3 100644
--- a/server/plugins-available/apps_vhost_plugin.inc.php
+++ b/server/plugins-available/apps_vhost_plugin.inc.php
@@ -70,17 +70,13 @@
 	// The purpose of this plugin is to rewrite the main.cf file
 	function update($event_name,$data) {
 		global $app, $conf;
-		
-		if(	$data['old']['apps_vhost_ip'] != $data['new']['apps_vhost_ip'] or
-			$data['old']['apps_vhost_port'] != $data['new']['apps_vhost_port'] or
-			$data['old']['apps_vhost_servername'] != $data['new']['apps_vhost_servername'] ) {
-		
+				
 		// get the config
 		$app->uses("getconf");
 		$web_config = $app->getconf->get_server_config($conf["server_id"], 'web');
 				
 		// Dont just copy over the virtualhost template but add some custom settings
-        $content = rf("conf/apache_apps.vhost.master");
+        $content = file_get_contents($conf["rootpath"]."/conf/apache_apps.vhost.master");
 		
 		$vhost_conf_dir = $web_config['vhost_conf_dir'];
         $vhost_conf_enabled_dir = $web_config['vhost_conf_enabled_dir'];
@@ -99,8 +95,9 @@
 			$content = str_replace('{vhost_port_listen}', '', $content);
 		}
 		
-		wf("$vhost_conf_dir/apps.vhost", $content);
-		}
+		file_put_contents("$vhost_conf_dir/apps.vhost", $content);
+		
+		$app->services->restartServiceDelayed('httpd','restart');
 		
 		
 	}

--
Gitblit v1.9.1