From 5bd2aa25f334944f4464fbb0086672286865ae7c Mon Sep 17 00:00:00 2001
From: florian030 <florian@schaal-24.de>
Date: Mon, 17 Feb 2014 07:51:42 -0500
Subject: [PATCH] Merge branch 'master' of http://git.ispconfig.org/ispconfig/ispconfig3
---
install/lib/install.lib.php | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index 4d5fe87..5686ac1 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -637,6 +637,11 @@
$out .= $line;
}
}
+ if (!$found) {
+ if (trim($line) == $new_line) {
+ $found = 1;
+ }
+ }
}
if($found == 0) {
//* add \n if the last line does not end with \n or \r
@@ -719,6 +724,32 @@
}
/*
+* Get the port number of the ISPConfig apps vhost
+*/
+
+function get_apps_vhost_port_number() {
+ global $conf;
+ if($conf['nginx']['installed'] == true){
+ $ispconfig_vhost_file = $conf['nginx']['vhost_conf_dir'].'/apps.vhost';
+ $regex = '/listen (\d+)/';
+ } else {
+ $ispconfig_vhost_file = $conf['apache']['vhost_conf_dir'].'/apps.vhost';
+ $regex = '/\<VirtualHost.*\:(\d{1,})\>/';
+ }
+
+ if(is_file($ispconfig_vhost_file)) {
+ $tmp = file_get_contents($ispconfig_vhost_file);
+ preg_match($regex, $tmp, $matches);
+ $port_number = @intval($matches[1]);
+ if($port_number > 0) {
+ return $port_number;
+ } else {
+ return '8081';
+ }
+ }
+}
+
+/*
* Get the port number of the ISPConfig controlpanel vhost
*/
--
Gitblit v1.9.1