From d96e29ee1a7569aa25197ade01f35522af1570d2 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Fri, 22 Aug 2014 08:51:43 +0200
Subject: [PATCH] - added alias- and subdomains to ssl domain select

---
 interface/web/sites/web_domain_edit.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php
index 1208e48a1e..b15222c193 100644
--- a/interface/web/sites/web_domain_edit.php
+++ b/interface/web/sites/web_domain_edit.php
@@ -406,8 +406,15 @@ class page_action extends tform_actions {
 		}
 
 		$ssl_domain_select = '';
-		$tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id = ".$this->id);
-		$ssl_domains = array($tmp["domain"], 'www.'.$tmp["domain"], '*.'.$tmp["domain"]);
+		$ssl_domains = array();
+		$tmpd = $app->db->queryAllRecords("SELECT domain, type FROM web_domain WHERE domain_id = ".$this->id." OR parent_domain_id = ".$this->id);
+		foreach($tmpd as $tmp) {
+			if($tmp['type'] == 'subdomain' || $tmp['type'] == 'vhostsubdomain']) {
+				$ssl_domains[] = $tmp["domain"];
+			} else {
+				$ssl_domains = array_merge($ssl_domains, array($tmp["domain"],'www.'.$tmp["domain"],'*.'.$tmp["domain"]));
+			}
+		}
 		if(is_array($ssl_domains)) {
 			foreach( $ssl_domains as $ssl_domain) {
 				$selected = ($ssl_domain == $this->dataRecord['ssl_domain'])?'SELECTED':'';
-- 
GitLab