Skip to content

Commit 378935a

Browse files
author
nveid
committed
Fixed mysql error when switching from "Options" tab to "Ftp User" edit tab,
the onUpdate thought we were trying to change the Website because the Options Datalog didn't have the parent_domain_id and the Ftp User tab did.
1 parent 45c0e8c commit 378935a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

interface/web/sites/ftp_user_edit.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ function onAfterInsert() {
139139

140140
$sql = "UPDATE ftp_user SET server_id = $server_id, dir = '$dir', uid = '$uid', gid = '$gid', sys_groupid = '$sys_groupid' WHERE ftp_user_id = ".$this->id;
141141
$app->db->query($sql);
142-
143-
144-
}
142+
}
145143

146144
function onBeforeUpdate() {
147145
global $app, $conf, $interfaceConf;
@@ -165,7 +163,7 @@ function onAfterUpdate() {
165163
global $app, $conf;
166164

167165
//* When the site of the FTP user has been changed
168-
if($this->oldDataRecord['parent_domain_id'] != $this->dataRecord['parent_domain_id']) {
166+
if(isset($this->dataRecord['parent_domain_id']) && $this->oldDataRecord['parent_domain_id'] != $this->dataRecord['parent_domain_id']) {
169167
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"]));
170168
$server_id = $web["server_id"];
171169
$dir = $web["document_root"];
@@ -206,4 +204,4 @@ function getClientName() {
206204
$page = new page_action;
207205
$page->onLoad();
208206

209-
?>
207+
?>

0 commit comments

Comments
 (0)