Skip to content

Commit 896a582

Browse files
committed
- Fixed "no_domain_perm" error when trying to add proxy directives for subdomains or alias domains (nginx).
1 parent f1eaceb commit 896a582

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

interface/web/sites/web_aliasdomain_edit.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,17 @@ function onShowEnd() {
123123

124124
function onSubmit() {
125125
global $app, $conf;
126+
127+
// Get the record of the parent domain
128+
if(!@$this->dataRecord["parent_domain_id"] && $this->id) {
129+
$tmp = $app->db->queryOneRecord("SELECT parent_domain_id FROM web_domain WHERE domain_id = ".$app->functions->intval($this->id));
130+
if($tmp) $this->dataRecord["parent_domain_id"] = $tmp['parent_domain_id'];
131+
unset($tmp);
132+
}
126133

127134
// Get the record of the parent domain
128135
$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'));
136+
129137
if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
130138
/* check if the domain module is used - and check if the selected domain can be used! */
131139
$app->uses('ini_parser,getconf');
@@ -153,7 +161,7 @@ function onSubmit() {
153161

154162
//* make sure that the domain is lowercase
155163
if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
156-
164+
157165
parent::onSubmit();
158166
}
159167

interface/web/sites/web_subdomain_edit.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ function onShowEnd() {
130130

131131
function onSubmit() {
132132
global $app, $conf;
133+
134+
// Get the record of the parent domain
135+
if(!@$this->dataRecord["parent_domain_id"] && $this->id) {
136+
$tmp = $app->db->queryOneRecord("SELECT parent_domain_id FROM web_domain WHERE domain_id = ".$app->functions->intval($this->id));
137+
if($tmp) $this->dataRecord["parent_domain_id"] = $tmp['parent_domain_id'];
138+
unset($tmp);
139+
}
133140

134141
// Get the record of the parent domain
135142
$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'));
@@ -162,7 +169,7 @@ function onSubmit() {
162169

163170
//* make sure that the domain is lowercase
164171
if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
165-
172+
166173
parent::onSubmit();
167174
}
168175

0 commit comments

Comments
 (0)