File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -206,8 +206,6 @@ public function setup( $user ) {
206206 // TODO: support for LE
207207 }
208208
209-
210-
211209 // Start the WebDAV service on the given port.
212210 $ cmd = 'runuser -l ' . $ user . ' -c " ' ;
213211 $ cmd .= "(rclone serve webdav --addr $ ip: $ port /home/ $ user/web) > /dev/null 2>&1 & " ;
@@ -220,16 +218,21 @@ public function setup( $user ) {
220218 public function priv_delete_user ( $ args ) {
221219 global $ hcpp ;
222220 $ user = $ args [0 ];
223- $ hostname = $ hcpp ->delLeftMost ( $ hcpp ->getLeftMost ( $ _SERVER ['HTTP_HOST ' ], ': ' ), '. ' );
224- $ link = "/etc/nginx/conf.d/domains/webdav- $ user. $ hostname.conf " ;
221+
222+ // Get the domain
223+ if ( $ this ->domain === "" ) {
224+ $ this ->domain = trim ( shell_exec ( 'hostname -d ' ) );
225+ }
226+ $ domain = $ this ->domain ;
227+ $ link = "/etc/nginx/conf.d/domains/webdav- $ user. $ domain.conf " ;
225228 if ( is_link ( $ link ) ) {
226229 unlink ( $ link );
227230 }
228- $ link = "/etc/nginx/conf.d/domains/webdav- $ user. $ hostname .ssl.conf " ;
231+ $ link = "/etc/nginx/conf.d/domains/webdav- $ user. $ domain .ssl.conf " ;
229232 if ( is_link ( $ link ) ) {
230233 unlink ( $ link );
231234 }
232- $ link = "/etc/apache2/conf.d/domains/webdav- $ user. $ hostname .conf " ;
235+ $ link = "/etc/apache2/conf.d/domains/webdav- $ user. $ domain .conf " ;
233236 if ( is_link ( $ link ) ) {
234237 unlink ( $ link );
235238 }
You can’t perform that action at this time.
0 commit comments