From 73b52f7d2bbe5ef267384afe79115d19ec98ca7e Mon Sep 17 00:00:00 2001 From: Alexandre Alouit Date: Tue, 2 Feb 2016 08:06:08 +0100 Subject: improvements alias domain support --- src/server/plugins-available/nginx_plugin.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/server/plugins-available/nginx_plugin.inc.php') diff --git a/src/server/plugins-available/nginx_plugin.inc.php b/src/server/plugins-available/nginx_plugin.inc.php index b3eecfa..69416b9 100755 --- a/src/server/plugins-available/nginx_plugin.inc.php +++ b/src/server/plugins-available/nginx_plugin.inc.php @@ -1119,12 +1119,14 @@ class nginx_plugin { OR ($data['old']['domain'] != $data['new']['domain']) // we have domain update OR ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain OR ($data['new']['type'] == 'subdomain') // we have new or update on subdomain + OR ($data['old']['type'] == 'alias' OR $data['new']['type'] == 'alias') // we have new or update on alias domain )) { // default values $temp_domains = array(); $lddomain = $domain; $subdomains = null; + $aliasdomains = null; //* be sure to have good domain if($data['new']['subdomain'] == "www" OR $data['new']['subdomain'] == "*") { @@ -1139,6 +1141,14 @@ 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'"); + if(is_array($aliasdomains)) { + foreach($aliasdomains as $aliasdomain) { + $temp_domains[] = $aliasdomain['domain']; + } + } + // prevent duplicate $temp_domains = array_unique($temp_domains); -- cgit v1.2.3