File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments