From 79c225f27ced11e7c1932a1ea69c9cb145927ec2 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 04 May 2009 10:23:28 -0400
Subject: [PATCH] Fixed: FS#723 - Unable to create email catch-alls even when an account has permissions to do so.

---
 server/plugins-available/shelluser_jailkit_plugin.inc.php |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/plugins-available/shelluser_jailkit_plugin.inc.php b/server/plugins-available/shelluser_jailkit_plugin.inc.php
index 308178f..666251b 100755
--- a/server/plugins-available/shelluser_jailkit_plugin.inc.php
+++ b/server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -87,7 +87,7 @@
 			
 				$this->_setup_jailkit_chroot();
 				
-				$command .= 'usermod --unlock '.escapeshellcmd($data['new']['username']);
+				$command .= 'usermod -U '.escapeshellcmd($data['new']['username']);
 				exec($command);
 				
 				$this->_add_jailkit_user();
@@ -151,8 +151,12 @@
 			//commented out proved to be dangerous on config errors
 			//exec('rm -rf '.$data['old']['dir'].$jailkit_chroot_userhome);
 			
-			
-			$app->log("Jailkit Plugin -> delete chroot home:".$data['old']['dir'].$jailkit_chroot_userhome,LOGLEVEL_DEBUG);
+			if(@is_dir($data['old']['dir'].$jailkit_chroot_userhome)) {
+				$command = 'userdel -f -r';
+				$command .= ' '.escapeshellcmd($data['old']['username']);
+				exec($command);
+				$app->log("Jailkit Plugin -> delete chroot home:".$data['old']['dir'].$jailkit_chroot_userhome,LOGLEVEL_DEBUG);
+			}
 		}
 		
 		$app->log("Jailkit Plugin -> delete username:".$data['old']['username'],LOGLEVEL_DEBUG);

--
Gitblit v1.9.1