From ebbe6374fc9c308daf729d2ad1b2f8007ed771ce Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Mon, 17 Feb 2014 05:34:43 -0500
Subject: [PATCH] Merge remote-tracking branch 'origin/stable-3.0.5'
---
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