From e60d4c7e35e5dd3a5f4fb1d5b3a25345b6275146 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Fri, 24 Jan 2014 06:41:38 -0500
Subject: [PATCH] Merge remote-tracking branch 'renky/vhostalias'
---
interface/web/sites/web_domain_edit.php | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php
index f47b30d..738bbab 100644
--- a/interface/web/sites/web_domain_edit.php
+++ b/interface/web/sites/web_domain_edit.php
@@ -1012,7 +1012,7 @@
$records = $app->db->queryAllRecords("SELECT domain_id, `domain`, `type`, `web_folder` FROM web_domain WHERE parent_domain_id = ".$this->id);
foreach($records as $rec) {
$update_columns = "sys_userid = '".$web_rec['sys_userid']."', sys_groupid = '".$web_rec['sys_groupid']."'";
- if($rec['type'] == 'vhostsubdomain') {
+ if($rec['type'] == 'vhostsubdomain' || $rec['type'] == 'vhostalias') {
$php_open_basedir = str_replace("[website_path]/web", $document_root.'/'.$rec['web_folder'], $web_config["php_open_basedir"]);
$php_open_basedir = str_replace("[website_domain]/web", $rec['domain'].'/'.$rec['web_folder'], $php_open_basedir);
$php_open_basedir = str_replace("[website_path]", $document_root, $php_open_basedir);
@@ -1037,7 +1037,7 @@
//* If the domain name has been changed, we will have to change all subdomains + APS instances
if(!empty($this->dataRecord["domain"]) && !empty($this->oldDataRecord["domain"]) && $this->dataRecord["domain"] != $this->oldDataRecord["domain"]) {
- $records = $app->db->queryAllRecords("SELECT domain_id,domain FROM web_domain WHERE (type = 'subdomain' OR type = 'vhostsubdomain') AND domain LIKE '%.".$app->db->quote($this->oldDataRecord["domain"])."'");
+ $records = $app->db->queryAllRecords("SELECT domain_id,domain FROM web_domain WHERE (type = 'subdomain' OR type = 'vhostsubdomain' OR type = 'vhostalias') AND domain LIKE '%.".$app->db->quote($this->oldDataRecord["domain"])."'");
foreach($records as $rec) {
$subdomain = $app->db->quote(str_replace($this->oldDataRecord["domain"], $this->dataRecord["domain"], $rec['domain']));
$app->db->datalogUpdate('web_domain', "domain = '".$subdomain."'", 'domain_id', $rec['domain_id']);
@@ -1097,9 +1097,9 @@
unset($backup_interval);
}
- //* Change vhost subdomain ip/ipv6 if domain ip/ipv6 has changed
+ //* Change vhost subdomain and alias ip/ipv6 if domain ip/ipv6 has changed
if(isset($this->dataRecord['ip_address']) && ($this->dataRecord['ip_address'] != $this->oldDataRecord['ip_address'] || $this->dataRecord['ipv6_address'] != $this->oldDataRecord['ipv6_address'])) {
- $records = $app->db->queryAllRecords("SELECT domain_id FROM web_domain WHERE type = 'vhostsubdomain' AND parent_domain_id = ".$this->id);
+ $records = $app->db->queryAllRecords("SELECT domain_id FROM web_domain WHERE (type = 'vhostsubdomain' OR type = 'vhostalias') AND parent_domain_id = ".$this->id);
foreach($records as $rec) {
$app->db->datalogUpdate('web_domain', "ip_address = '".$app->db->quote($web_rec['ip_address'])."', ipv6_address = '".$app->db->quote($web_rec['ipv6_address'])."'", 'domain_id', $rec['domain_id']);
}
--
Gitblit v1.9.1