Skip to content

Commit c4aba1a

Browse files
author
Till Brehm
committed
Fixed: #4059 can't edit existing subdomain
1 parent f7c6188 commit c4aba1a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

interface/lib/classes/tools_sites.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function getDomainModuleDomains($not_used_in_table = null, $selected_domain = nu
157157
$field = "domain";
158158
$select = $field;
159159
}
160-
$sql .= " domain NOT IN (SELECT $select FROM ?? WHERE $field != ?) AND";
160+
$sql .= " domain NOT IN (SELECT $select FROM ?? WHERE $field = ?) AND";
161161
}
162162
if ($_SESSION["s"]["user"]["typ"] == 'admin') {
163163
$sql .= " 1";

interface/web/sites/web_childdomain_edit.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ function onShowEnd() {
131131
}
132132
$app->tpl->setVar("domain_option", $domain_select);
133133
if($this->_childdomain_type == 'subdomain') {
134-
$this->dataRecord['domain'] = substr($this->dataRecord["domain"], 0, strlen($this->dataRecord['domain']) - strlen($selected_domain) - 1);
134+
//$this->dataRecord['domain'] = substr($this->dataRecord["domain"], 0, strlen($this->dataRecord['domain']) - strlen($selected_domain) - 1);
135+
$this->dataRecord["domain"] = str_replace('.'.$selected_domain, '', $this->dataRecord["domain"]);
135136
}
137+
136138
} else {
137139
if($this->_childdomain_type == 'subdomain') {
138140
// Get the record of the parent domain

0 commit comments

Comments
 (0)