From c653844975fb13bf7aaf2cc0dc96c8c70906394e Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Thu, 14 Aug 2014 03:46:18 -0400
Subject: [PATCH] Fixed: FS#3564 - shell users accounts are not removed.

---
 server/plugins-available/shelluser_base_plugin.inc.php    |    2 +-
 server/plugins-available/shelluser_jailkit_plugin.inc.php |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php
index e331624..67cbee0 100755
--- a/server/plugins-available/shelluser_base_plugin.inc.php
+++ b/server/plugins-available/shelluser_base_plugin.inc.php
@@ -231,7 +231,7 @@
 			if($userid > $this->min_uid) {
 				// We delete only non jailkit users, jailkit users will be deleted by the jailkit plugin.
 				if ($data['old']['chroot'] != "jailkit") {
-					$command = 'userdel -f';
+					$command = 'killall -u '.escapeshellcmd($data['old']['username']).' ; userdel -f';
 					$command .= ' '.escapeshellcmd($data['old']['username']).' &> /dev/null';
 					exec($command);
 					$app->log("Deleted shelluser: ".$data['old']['username'], LOGLEVEL_DEBUG);
diff --git a/server/plugins-available/shelluser_jailkit_plugin.inc.php b/server/plugins-available/shelluser_jailkit_plugin.inc.php
index 9cf6fc8..f0fb279 100755
--- a/server/plugins-available/shelluser_jailkit_plugin.inc.php
+++ b/server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -226,7 +226,7 @@
 			$app->system->web_folder_protection($web['document_root'], false);
 
 			if(@is_dir($data['old']['dir'].$jailkit_chroot_userhome)) {
-				$command = 'userdel -f';
+				$command = 'killall -u '.escapeshellcmd($data['old']['username']).' ; userdel -f';
 				$command .= ' '.escapeshellcmd($data['old']['username']).' &> /dev/null';
 				exec($command);
 				$app->log("Jailkit Plugin -> delete chroot home:".$data['old']['dir'].$jailkit_chroot_userhome, LOGLEVEL_DEBUG);

--
Gitblit v1.9.1