Skip to content

Commit ee3584c

Browse files
author
vogelor
committed
fixed a bug in disallow changing server
1 parent 2534b97 commit ee3584c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

interface/web/sites/web_domain_edit.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,15 @@ function onBeforeUpdate () {
251251
//* Check if the server has been changed
252252
// We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
253253
if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
254-
$rec = $app->db->queryOneRecord("SELECT server_id from web_domain WHERE domain_id = ".$this->id);
255-
if($rec['server_id'] != $this->dataRecord["server_id"]) {
256-
//* Add a error message and switch back to old server
257-
$app->tform->errorMessage .= $app->lng('The Server can not be changed.');
258-
$this->dataRecord["server_id"] = $rec['server_id'];
254+
if (isset($this->dataRecord["server_id"])){
255+
$rec = $app->db->queryOneRecord("SELECT server_id from web_domain WHERE domain_id = ".$this->id);
256+
if($rec['server_id'] != $this->dataRecord["server_id"]) {
257+
//* Add a error message and switch back to old server
258+
$app->tform->errorMessage .= $app->lng('The Server can not be changed.');
259+
$this->dataRecord["server_id"] = $rec['server_id'];
260+
}
261+
unset($rec);
259262
}
260-
unset($rec);
261263
}
262264

263265
//* Check that all fields for the SSL cert creation are filled

0 commit comments

Comments
 (0)