- 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:
42
lib/functions/froxlor/function.isCustomerStdSubdomain.php
Normal file
42
lib/functions/froxlor/function.isCustomerStdSubdomain.php
Normal 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;
|
||||
}
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user