Skip to content

Commit 9a02e24

Browse files
author
Marius Cramer
committed
Resolved differences in aliasdomain/subdomain files
1 parent 1c36558 commit 9a02e24

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

interface/web/sites/web_aliasdomain_edit.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ function onShowEnd() {
124124
function onSubmit() {
125125
global $app, $conf;
126126

127+
// Get the record of the parent domain
128+
$parent_domain = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r'));
129+
if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
127130
/* check if the domain module is used - and check if the selected domain can be used! */
128131
$app->uses('ini_parser,getconf');
129132
$settings = $app->getconf->get_global_config('domains');
@@ -142,14 +145,9 @@ function onSubmit() {
142145
$app->tform->errorMessage .= $app->tform->lng("error_proxy_requires_url")."<br />";
143146
}
144147

145-
// Get the record of the parent domain
146-
$parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r'));
147-
if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
148-
149148
// Set a few fixed values
150149
$this->dataRecord["type"] = 'alias';
151150
$this->dataRecord["server_id"] = $parent_domain["server_id"];
152-
//$this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"];
153151

154152
$this->parent_domain_record = $parent_domain;
155153

@@ -178,7 +176,7 @@ function onAfterUpdate() {
178176
//* Update the old website, so that the vhost alias gets removed
179177
//* We force the update by inserting a transaction record without changes manually.
180178
$old_website = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '.$app->functions->intval($this->oldDataRecord['domain_id']));
181-
$app->db->datalogSave('web_domain', 'UPDATE', 'domain_id', $this->oldDataRecord['parent_domain_id'], $old_website, $old_website, true);
179+
$app->db->datalogSave('web_domain', 'UPDATE', 'domain_id', $app->functions->intval($this->oldDataRecord['parent_domain_id']), $old_website, $old_website, true);
182180
}
183181

184182
}

interface/web/sites/web_subdomain_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function onSubmit() {
134134
// Get the record of the parent domain
135135
$parent_domain = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r'));
136136
if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
137-
137+
/* check if the domain module is used - and check if the selected domain can be used! */
138138
$app->uses('ini_parser,getconf');
139139
$settings = $app->getconf->get_global_config('domains');
140140
if ($settings['use_domain_module'] == 'y') {

0 commit comments

Comments
 (0)