Skip to content

Commit a636a17

Browse files
author
Florian Schaal
committed
Update SSL Domain field with Domain name (Fixes: #4089)
1 parent 03e4ab6 commit a636a17

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ function sites_web_vhost_domain_edit($event_name, $page_form) {
198198

199199
//* If the domain name has been changed, we will have to change all subdomains + APS instances
200200
if(!empty($page_form->dataRecord["domain"]) && !empty($page_form->oldDataRecord["domain"]) && $page_form->dataRecord["domain"] != $page_form->oldDataRecord["domain"]) {
201+
//* Change SSL Domain
202+
$tmp=$app->db->queryOneRecord("SELECT ssl_domain FROM web_domain WHERE domain_id = ?", $page_form->id);
203+
if($tmp['ssl_domain'] != '') {
204+
$plain=str_replace($page_form->oldDataRecord["domain"], $page_form->dataRecord["domain"], $tmp);
205+
$app->db->query("UPDATE web_domain SET ssl_domain = ? WHERE domain_id = ?", $plain, $page_form->id);
206+
}
207+
201208
$records = $app->db->queryAllRecords("SELECT domain_id,domain FROM web_domain WHERE (type = 'subdomain' OR type = 'vhostsubdomain' OR type = 'vhostalias') AND domain LIKE ?", "%." . $page_form->oldDataRecord["domain"]);
202209
foreach($records as $rec) {
203210
$subdomain = str_replace($page_form->oldDataRecord["domain"], $page_form->dataRecord["domain"], $rec['domain']);

0 commit comments

Comments
 (0)