From d4db604730b0a843ff526506abeadc0ae72d03b0 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 3 May 2010 16:14:48 +0000
Subject: [PATCH] Fixed a php warning and removed -f switch from userdel
 command in jailkit plugin.

---
 interface/web/monitor/show_sys_state.php               | 10 ++++++----
 .../plugins-available/shelluser_jailkit_plugin.inc.php |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/interface/web/monitor/show_sys_state.php b/interface/web/monitor/show_sys_state.php
index e08930486..839186284 100644
--- a/interface/web/monitor/show_sys_state.php
+++ b/interface/web/monitor/show_sys_state.php
@@ -153,10 +153,12 @@ function _getSysState() {
 			$html .= $data['html_server'];
 			/* get all VE's of this server */
 			$veInfo = $data['ve_info'];
-			foreach ($veInfo as $info) {
-				for ($i = 0; $i < sizeof($serverData); $i++) {
-					if ($serverData[$i]['server_name'] == $info['hostname']) {
-						$html = str_replace('##VE_INFO##', $serverData[$i]['html_ve'] . '##VE_INFO##', $html);
+			if(is_array($veInfo)) {
+				foreach ($veInfo as $info) {
+					for ($i = 0; $i < sizeof($serverData); $i++) {
+						if ($serverData[$i]['server_name'] == $info['hostname']) {
+							$html = str_replace('##VE_INFO##', $serverData[$i]['html_ve'] . '##VE_INFO##', $html);
+						}
 					}
 				}
 			}
diff --git a/server/plugins-available/shelluser_jailkit_plugin.inc.php b/server/plugins-available/shelluser_jailkit_plugin.inc.php
index 743c4e241..c1b32abb7 100755
--- a/server/plugins-available/shelluser_jailkit_plugin.inc.php
+++ b/server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -160,7 +160,7 @@ class shelluser_jailkit_plugin {
 			//exec('rm -rf '.$data['old']['dir'].$jailkit_chroot_userhome);
 			
 			if(@is_dir($data['old']['dir'].$jailkit_chroot_userhome)) {
-				$command = 'userdel -f';
+				$command = 'userdel';
 				$command .= ' '.escapeshellcmd($data['old']['username']);
 				exec($command);
 				$app->log("Jailkit Plugin -> delete chroot home:".$data['old']['dir'].$jailkit_chroot_userhome,LOGLEVEL_DEBUG);
-- 
GitLab