From ac28b53f1795d9299295a438ac16aa15a43a5b72 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 22 Sep 2011 08:46:47 -0400
Subject: [PATCH] Removed message from installer.

---
 install/lib/installer_base.lib.php |   49 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 7e6fc23..fb4360c 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -123,7 +123,7 @@
 		if(is_installed('courierlogger')) $conf['courier']['installed'] = true;
 		if(is_installed('dovecot')) $conf['dovecot']['installed'] = true;
 		if(is_installed('saslauthd')) $conf['saslauthd']['installed'] = true;
-		if(is_installed('amavisd-new')) $conf['amavis']['installed'] = true;
+		if(is_installed('amavisd-new') || is_installed('amavisd')) $conf['amavis']['installed'] = true;
 		if(is_installed('clamdscan')) $conf['clamav']['installed'] = true;
 		if(is_installed('pure-ftpd') || is_installed('pure-ftpd-wrapper')) $conf['pureftpd']['installed'] = true;
 		if(is_installed('mydns') || is_installed('mydns-ng')) $conf['mydns']['installed'] = true;
@@ -233,16 +233,18 @@
 		$tpl_ini_array['dns']['named_conf_path'] = $conf['bind']['named_conf_path'];
 		$tpl_ini_array['dns']['named_conf_local_path'] = $conf['bind']['named_conf_local_path'];
 		
+		$tpl_ini_array['web']['nginx_vhost_conf_dir'] = $conf['nginx']['vhost_conf_dir'];
+		$tpl_ini_array['web']['nginx_vhost_conf_enabled_dir'] = $conf['nginx']['vhost_conf_enabled_dir'];
+		$tpl_ini_array['web']['nginx_user'] = $conf['nginx']['user'];
+		$tpl_ini_array['web']['nginx_group'] = $conf['nginx']['group'];
+		$tpl_ini_array['web']['nginx_cgi_socket'] = $conf['nginx']['cgi_socket'];
+		$tpl_ini_array['web']['php_fpm_init_script'] = $conf['nginx']['php_fpm_init_script'];
+		$tpl_ini_array['web']['php_fpm_ini_path'] = $conf['nginx']['php_fpm_ini_path'];
+		$tpl_ini_array['web']['php_fpm_pool_dir'] = $conf['nginx']['php_fpm_pool_dir'];
+		$tpl_ini_array['web']['php_fpm_start_port'] = $conf['nginx']['php_fpm_start_port'];
+		$tpl_ini_array['web']['php_fpm_socket_dir'] = $conf['nginx']['php_fpm_socket_dir'];
+		
 		if ($conf['nginx']['installed'] == true) {
-			$tpl_ini_array['web']['nginx_vhost_conf_dir'] = $conf['nginx']['vhost_conf_dir'];
-			$tpl_ini_array['web']['nginx_vhost_conf_enabled_dir'] = $conf['nginx']['vhost_conf_enabled_dir'];
-			$tpl_ini_array['web']['nginx_user'] = $conf['nginx']['user'];
-			$tpl_ini_array['web']['nginx_group'] = $conf['nginx']['group'];
-			$tpl_ini_array['web']['nginx_cgi_socket'] = $conf['nginx']['cgi_socket'];
-			$tpl_ini_array['web']['php_fpm_init_script'] = $conf['nginx']['php_fpm_init_script'];
-			$tpl_ini_array['web']['php_fpm_ini_path'] = $conf['nginx']['php_fpm_ini_path'];
-			$tpl_ini_array['web']['php_fpm_pool_dir'] = $conf['nginx']['php_fpm_pool_dir'];
-			$tpl_ini_array['web']['php_fpm_start_port'] = $conf['nginx']['php_fpm_start_port'];
 			$tpl_ini_array['web']['server_type'] = 'nginx';
 			$tpl_ini_array['global']['webserver'] = 'nginx';
 		}
@@ -922,12 +924,7 @@
 		$postconf_commands = array ();
 		
 		// Check for amavisd -> pure webserver with postfix for mailing without antispam
-		// Check for different names
-		system('which amavisd-new', $retval); // Debian, Ubuntu, ?
-		if ($retval !== 0){
-			system('which amavisd', $retval); // CentOS
-		}
-		if ($retval === 0) {
+		if ($conf['amavis']['installed']) {
 			$postconf_commands[] = 'content_filter = amavis:[127.0.0.1]:10024';
 			$postconf_commands[] = 'receive_override_options = no_address_mappings';
 		}
@@ -1144,15 +1141,29 @@
 		$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
 
 		// copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf');
-
+		
 		$content = rf('tpl/apache_ispconfig.conf.master');
 		$records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'");
+
 		if(is_array($records) && count($records) > 0) {
 			foreach($records as $rec) {
-				$content .= 'NameVirtualHost '.$rec['ip_address'].":80\n";
-				$content .= 'NameVirtualHost '.$rec['ip_address'].":443\n";
+				if($rec['ip_type'] == 'IPv6') {
+					$ip_address = '['.$rec['ip_address'].']';
+				} else {
+					$ip_address = $rec['ip_address'];
+				}
+				$ports = explode(',',$rec['virtualhost_port']);
+				if(is_array($ports)) {
+					foreach($ports as $port) {
+						$port = intval($port);
+						if($port > 0 && $port < 65536 && $ip_address != '') {
+							$content .= 'NameVirtualHost '.$ip_address.":".$port."\n";
+						}
+					}
+				}
 			}
 		}
+		
 		$content .= "\n";
 		wf($vhost_conf_dir.'/ispconfig.conf',$content);
 

--
Gitblit v1.9.1