Skip to content

Commit 2da616a

Browse files
committed
Fixed: FS#967 - Changing website client makes FTP unaccesable.
1 parent 328e6ce commit 2da616a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

interface/web/sites/web_domain_edit.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,23 @@ function onAfterUpdate() {
385385
$sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root' WHERE domain_id = ".$this->id;
386386
//$sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group' WHERE domain_id = ".$this->id;
387387
$app->db->query($sql);
388+
389+
// Update the FTP user(s) too
390+
$records = $app->db->queryAllRecords("SELECT ftp_user_id FROM ftp_user WHERE parent_domain_id = ".$this->id);
391+
foreach($records as $rec) {
392+
$app->db->datalogUpdate('ftp_user', "uid = '$system_user', gid = '$system_group', dir = '$document_root'", 'ftp_user_id', $rec['ftp_user_id']);
393+
}
394+
unset($records);
395+
unset($rec);
396+
397+
// Update the Shell user(s) too
398+
$records = $app->db->queryAllRecords("SELECT shell_user_id FROM shell_user WHERE parent_domain_id = ".$this->id);
399+
foreach($records as $rec) {
400+
$app->db->datalogUpdate('shell_user', "puser = '$system_user', pgroup = '$system_group', dir = '$document_root'", 'shell_user_id', $rec['shell_user_id']);
401+
}
402+
unset($records);
403+
unset($rec);
404+
388405
}
389406

390407
//* If the domain name has been changed, we will have to change all subdomains

0 commit comments

Comments
 (0)