From 9c9a7d2ac863c8e78323c10c891147bfd0c7c6ae Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 12 Dec 2012 10:33:05 -0500
Subject: [PATCH] Implemented: FS#2582 - Add support for SSL bundle certificates (SSLCACertificateFile) in ispconfig apache vhost

---
 install/lib/installer_base.lib.php        |    5 +++++
 install/dist/lib/fedora.lib.php           |    5 +++++
 install/tpl/apache_ispconfig.vhost.master |    1 +
 install/dist/lib/gentoo.lib.php           |    5 +++++
 install/dist/lib/opensuse.lib.php         |    5 +++++
 5 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php
index 964d17b..dabd142 100644
--- a/install/dist/lib/fedora.lib.php
+++ b/install/dist/lib/fedora.lib.php
@@ -941,6 +941,11 @@
 			} else {
 				$content = str_replace('{ssl_comment}', '#', $content);
 			}
+			if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key') && is_file($install_dir.'/interface/ssl/ispserver.bundle')) {
+				$content = str_replace('{ssl_bundle_comment}', '', $content);
+			} else {
+				$content = str_replace('{ssl_bundle_comment}', '#', $content);
+			}
 		
 			wf("$vhost_conf_dir/ispconfig.vhost", $content);
 		
diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php
index db2cf6e..2564dc9 100644
--- a/install/dist/lib/gentoo.lib.php
+++ b/install/dist/lib/gentoo.lib.php
@@ -929,6 +929,11 @@
 			} else {
 				$content = str_replace('{ssl_comment}', '#', $content);
 			}
+			if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key') && is_file($install_dir.'/interface/ssl/ispserver.bundle')) {
+				$content = str_replace('{ssl_bundle_comment}', '', $content);
+			} else {
+				$content = str_replace('{ssl_bundle_comment}', '#', $content);
+			}
 		
 			$vhost_path = $conf['apache']['vhost_conf_dir'].'/ispconfig.vhost';
 			$this->write_config_file($vhost_path, $content);
diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php
index 97a2a6f..2b3c225 100644
--- a/install/dist/lib/opensuse.lib.php
+++ b/install/dist/lib/opensuse.lib.php
@@ -977,6 +977,11 @@
 			} else {
 				$content = str_replace('{ssl_comment}', '#', $content);
 			}
+			if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key') && is_file($install_dir.'/interface/ssl/ispserver.bundle')) {
+				$content = str_replace('{ssl_bundle_comment}', '', $content);
+			} else {
+				$content = str_replace('{ssl_bundle_comment}', '#', $content);
+			}
 		
 			$content = str_replace('/var/www/', '/srv/www/', $content);
 		
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 65cafa9..815985d 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -1885,6 +1885,11 @@
 			} else {
 				$content = str_replace('{ssl_comment}', '#', $content);
 			}
+			if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key') && is_file($install_dir.'/interface/ssl/ispserver.bundle')) {
+				$content = str_replace('{ssl_bundle_comment}', '', $content);
+			} else {
+				$content = str_replace('{ssl_bundle_comment}', '#', $content);
+			}
 
 			wf($vhost_conf_dir.'/ispconfig.vhost', $content);
 
diff --git a/install/tpl/apache_ispconfig.vhost.master b/install/tpl/apache_ispconfig.vhost.master
index e00f293..0385427 100644
--- a/install/tpl/apache_ispconfig.vhost.master
+++ b/install/tpl/apache_ispconfig.vhost.master
@@ -53,6 +53,7 @@
   {ssl_comment}SSLEngine On
   {ssl_comment}SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
   {ssl_comment}SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
+  {ssl_bundle_comment}SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle
 
 </VirtualHost>
 

--
Gitblit v1.9.1