From ab8d08cf39481d30d581ab65ca9fa745746e711e Mon Sep 17 00:00:00 2001 From: Alexandre Alouit Date: Thu, 4 Feb 2016 15:54:37 +0100 Subject: bugfix support subdomain for alias domain --- src/server/plugins-available/apache2_plugin.inc.php | 5 ++++- src/server/plugins-available/nginx_plugin.inc.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/plugins-available/apache2_plugin.inc.php b/src/server/plugins-available/apache2_plugin.inc.php index 755d0e1..5ac6c78 100755 --- a/src/server/plugins-available/apache2_plugin.inc.php +++ b/src/server/plugins-available/apache2_plugin.inc.php @@ -981,10 +981,13 @@ class apache2_plugin { } //* then, add alias domain if we have - $aliasdomains = $app->db->queryAllRecords('SELECT domain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'alias'"); + $aliasdomains = $app->db->queryAllRecords('SELECT domain,subdomain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'alias'"); if(is_array($aliasdomains)) { foreach($aliasdomains as $aliasdomain) { $temp_domains[] = $aliasdomain['domain']; + if(isset($aliasdomain['subdomain']) && ! empty($aliasdomain['subdomain'])) { + $temp_domains[] = $aliasdomain['subdomain'] . "." . $aliasdomain['domain']; + } } } diff --git a/src/server/plugins-available/nginx_plugin.inc.php b/src/server/plugins-available/nginx_plugin.inc.php index 5c77632..d72591c 100755 --- a/src/server/plugins-available/nginx_plugin.inc.php +++ b/src/server/plugins-available/nginx_plugin.inc.php @@ -1142,10 +1142,13 @@ class nginx_plugin { } //* then, add alias domain if we have - $aliasdomains = $app->db->queryAllRecords('SELECT domain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'alias'"); + $aliasdomains = $app->db->queryAllRecords('SELECT domain,subdomain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'alias'"); if(is_array($aliasdomains)) { foreach($aliasdomains as $aliasdomain) { $temp_domains[] = $aliasdomain['domain']; + if(isset($aliasdomain['subdomain']) && ! empty($aliasdomain['subdomain'])) { + $temp_domains[] = $aliasdomain['subdomain'] . "." . $aliasdomain['domain']; + } } } -- cgit v1.2.3