From d16282430f49f5c3d40ff95379813d5ff800604a Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Fri, 01 Mar 2013 11:05:09 -0500
Subject: [PATCH] - Fixed FS#2733 - The Linux shell users of a website does not get removed when the website is removed.
---
server/plugins-available/nginx_plugin.inc.php | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index 1a593aa..d6ec88e 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -466,7 +466,7 @@
exec('chown --recursive --from='.escapeshellcmd($data['old']['system_user']).':'.escapeshellcmd($data['old']['system_group']).' '.escapeshellcmd($data['new']['system_user']).':'.escapeshellcmd($data['new']['system_group']).' '.$new_dir);
//* Change the home directory and group of the website user
- $command = 'killall -u '.escapeshellcmd($data['new']['system_user']).' && usermod';
+ $command = 'killall -u '.escapeshellcmd($data['new']['system_user']).' ; usermod';
$command .= ' --home '.escapeshellcmd($data['new']['document_root']);
$command .= ' --gid '.escapeshellcmd($data['new']['system_group']);
$command .= ' '.escapeshellcmd($data['new']['system_user']).' 2>/dev/null';
@@ -1684,10 +1684,12 @@
if($data['old']['type'] == 'vhost' || $data['old']['type'] == 'vhostsubdomain'){
if(is_array($log_folders) && !empty($log_folders)){
foreach($log_folders as $log_folder){
- if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
+ //if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
+ exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
}
} else {
- if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
+ //if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
+ exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
}
}
@@ -1867,10 +1869,10 @@
$vhost_logfile_dir = escapeshellcmd('/var/log/ispconfig/httpd/'.$data['old']['domain']);
if($data['old']['domain'] != '' && !stristr($vhost_logfile_dir,'..')) exec('rm -rf '.$vhost_logfile_dir);
$app->log('Removing website logfile directory: '.$vhost_logfile_dir,LOGLEVEL_DEBUG);
-
+
if($data['old']['type'] == 'vhost') {
//delete the web user
- $command = 'killall -u '.escapeshellcmd($data['old']['system_user']).' && userdel';
+ $command = 'killall -u '.escapeshellcmd($data['old']['system_user']).' ; userdel';
$command .= ' '.escapeshellcmd($data['old']['system_user']);
exec($command);
if($nginx_chrooted) $this->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' '.$command);
--
Gitblit v1.9.1