solve sub-sub-domain-problem by dynamically assigning vhost-number in vhost-filename (the deeper the lower the number thus being included earlier), fixes #1535

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2015-07-28 15:11:55 +02:00
parent fce9de7372
commit a1d38dc05f
3 changed files with 15 additions and 12 deletions

View File

@@ -618,14 +618,15 @@ class apache {
&& ((int)$domain['ismainbutsubto'] == 0
|| domainMainToSubExists($domain['ismainbutsubto']) == false)
) {
$vhost_no = '22';
$vhost_no = '35';
} elseif ((int)$domain['parentdomainid'] == 0
&& isCustomerStdSubdomain((int)$domain['id']) == false
&& (int)$domain['ismainbutsubto'] > 0
) {
$vhost_no = '21';
$vhost_no = '30';
} else {
$vhost_no = '20';
// number of dots in a domain specifies it's position (and depth of subdomain) starting at 29 going downwards on higher depth
$vhost_no = (string)(30 - substr_count($domain['domain'], ".") + 1);
}
if ($ssl_vhost === true) {
@@ -1126,9 +1127,9 @@ class apache {
$vhosts_file = '';
// sort by filename so the order is:
// 1. subdomains 20
// 2. subdomains as main-domains 21
// 3. main-domains 22
// 1. subdomains x-29
// 2. subdomains as main-domains 30
// 3. main-domains 35
// #437
ksort($this->virtualhosts_data);