- put customer standard-subdomains to the 20_* vhost configs (subdomains) so they are parsed before the main-domain, fixes #465

This commit is contained in:
Michael Kaufmann (d00p)
2010-11-08 07:41:51 +00:00
parent a638dddec9
commit 08e17f7d16
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/*
* returns true or false whether a
* given domain id is the std-subdomain
* of a customer
*
* @param int domain-id
*
* @return boolean
*/
function isCustomerStdSubdomain($did = 0)
{
global $db;
if($did > 0)
{
$result = $db->query_first("SELECT `customerid` FROM `".TABLE_PANEL_CUSTOMERS."` WHERE `standardsubdomain` = '".(int)$did."'");
if(is_array($result)
&& isset($result['customerid'])
&& $result['customerid'] > 0
) {
return true;
}
}
return false;
}

View File

@@ -631,12 +631,14 @@ class apache
protected function getVhostFilename($domain, $ssl_vhost = false)
{
if((int)$domain['parentdomainid'] == 0
&& isCustomerStdSubdomain((int)$domain['id']) == false
&& ((int)$domain['ismainbutsubto'] == 0
|| domainMainToSubExists($domain['ismainbutsubto']) == false)
) {
$vhost_no = '22';
}
elseif((int)$domain['parentdomainid'] == 0
&& isCustomerStdSubdomain((int)$domain['id']) == false
&& (int)$domain['ismainbutsubto'] > 0
) {
$vhost_no = '21';

View File

@@ -309,6 +309,7 @@ class lighttpd
$_inc_path = substr($_tmp_path, $_pos+1);
if((int)$domain['parentdomainid'] == 0
&& isCustomerStdSubdomain((int)$domain['id']) == false
&& ((int)$domain['ismainbutsubto'] == 0
|| domainMainToSubExists($domain['ismainbutsubto']) == false)
) {
@@ -319,6 +320,7 @@ class lighttpd
}
}
elseif((int)$domain['parentdomainid'] == 0
&& isCustomerStdSubdomain((int)$domain['id']) == false
&& (int)$domain['ismainbutsubto'] > 0
) {
$vhost_no = '51';