Skip to content

Commit 4887d4e

Browse files
author
Till Brehm
committed
Fixed: FS#3188 - .ftpquota file remains
1 parent 82ff629 commit 4887d4e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

server/plugins-available/ftpuser_base_plugin.inc.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,24 @@ function update($event_name, $data) {
112112
exec('mkdir -p '.escapeshellcmd($data['new']['dir']));
113113
exec('chown '.escapeshellcmd($web["system_user"]).':'.escapeshellcmd($web['system_group']).' '.$data['new']['dir']);
114114
$app->system->web_folder_protection($web['document_root'], true);
115+
116+
115117

116118
$app->log("Added ftpuser_dir: ".$data['new']['dir'], LOGLEVEL_DEBUG);
117119
}
120+
121+
// When the directory has changed, delete the old .ftpquota file
122+
if($data['old']['dir'] != '' && $data['old']['dir'] != $data['new']['dir']) {
123+
if(is_file($data['old']['dir'].'/.ftpquota')) unlink($data['old']['dir'].'/.ftpquota');
124+
}
125+
118126
}
119127

120128
function delete($event_name, $data) {
121129
global $app, $conf;
130+
131+
// Delete the .ftpquota file
132+
if(is_file($data['old']['dir'].'/.ftpquota')) unlink($data['old']['dir'].'/.ftpquota');
122133

123134
$app->log("Ftpuser:".$data['new']['username']." deleted.", LOGLEVEL_DEBUG);
124135

0 commit comments

Comments
 (0)