Skip to content

Commit 4a599a8

Browse files
author
Till Brehm
committed
Merge branch '6491-fix-getDomainModuleDomains' into 'develop'
Resolve "Create webdomain form lists domains that are already used" Closes #6491 See merge request ispconfig/ispconfig3!1715
2 parents 56faee1 + f02f15e commit 4a599a8

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

interface/lib/classes/tools_sites.inc.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,13 @@ function convertClientName($name){
145145
}
146146

147147
/* TODO: rewrite SQL */
148-
function getDomainModuleDomains($not_used_in_table = null, $selected_domain = null) {
148+
function getDomainModuleDomains($not_used_in_table = null, $selected_domain = '') {
149149
global $app;
150150

151+
// Fix a null value passed in by the create new forms, which lack an id.
152+
if ($selected_domain == null) {
153+
$selected_domain = '';
154+
}
151155
$sql = "SELECT domain_id, domain FROM domain WHERE";
152156
if ($not_used_in_table) {
153157
if (strpos($not_used_in_table, 'dns') !== false) {

interface/web/dns/dns_wizard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
/*
197197
* The domain-module is in use.
198198
*/
199-
$domains = $app->tools_sites->getDomainModuleDomains("dns_soa", 'domain');
199+
$domains = $app->tools_sites->getDomainModuleDomains("dns_soa");
200200
$domain_select = "<option value=''></option>";
201201
if(is_array($domains) && sizeof($domains) > 0) {
202202
/* We have domains in the list, so create the drop-down-list */

interface/web/sites/web_childdomain_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function onShowEnd() {
105105
/*
106106
* The domain-module is in use.
107107
*/
108-
$domains = $app->tools_sites->getDomainModuleDomains($this->_vhostdomain_type == 'subdomain' ? null : "web_domain");
108+
$domains = $app->tools_sites->getDomainModuleDomains($this->_vhostdomain_type == 'subdomain' ? null : "web_domain", $this->dataRecord['domain']);
109109
$domain_select = "<option value=''></option>";
110110
$selected_domain = '';
111111
if(is_array($domains) && sizeof($domains) > 0) {

interface/web/sites/web_vhost_domain_edit.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,8 @@ function onShowEnd() {
694694
/*
695695
* The domain-module is in use.
696696
*/
697-
$domains = $app->tools_sites->getDomainModuleDomains($this->_vhostdomain_type == 'subdomain' ? null : "web_domain");
697+
$domains = $app->tools_sites->getDomainModuleDomains($this->_vhostdomain_type == 'subdomain' ? null : "web_domain", $this->dataRecord['domain']);
698+
698699
$domain_select = "<option value=''></option>";
699700
$selected_domain = '';
700701
if(is_array($domains) && sizeof($domains) > 0) {

0 commit comments

Comments
 (0)