From 934c7d1764ecdd739ed342e14056ad3c91c744ba Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 26 Jul 2010 10:09:30 -0400
Subject: [PATCH] Implemented: FS#1260 - Do not ask for port number during updates - The updater still asks for the port number, but with this update the default number that is shown is read from the vhost file as xaver suggested.

---
 install/lib/install.lib.php |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index a4e3880..f964445 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -677,6 +677,26 @@
 	
 }
 
+/*
+* Get the port number of the ISPConfig controlpanel vhost
+*/
+
+function get_ispconfig_port_number() {
+	global $conf;
+	$ispconfig_vhost_file = $conf['apache']['vhost_conf_dir'].'/ispconfig.vhost';
+
+	if(is_file($ispconfig_vhost_file)) {
+		$tmp = file_get_contents($ispconfig_vhost_file);
+		preg_match('/\<VirtualHost.*\:(\d{1,})\>/',$tmp,$matches);
+		$port_number = intval($matches[1]);
+		if($port_number > 0) {
+			return $port_number;
+		} else {
+			return '8080';
+		}
+	}
+}
+
 
 
 ?>

--
Gitblit v1.9.1