Skip to content

Commit d4db604

Browse files
committed
Fixed a php warning and removed -f switch from userdel command in jailkit plugin.
1 parent a2cb144 commit d4db604

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

interface/web/monitor/show_sys_state.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@ function _getSysState() {
153153
$html .= $data['html_server'];
154154
/* get all VE's of this server */
155155
$veInfo = $data['ve_info'];
156-
foreach ($veInfo as $info) {
157-
for ($i = 0; $i < sizeof($serverData); $i++) {
158-
if ($serverData[$i]['server_name'] == $info['hostname']) {
159-
$html = str_replace('##VE_INFO##', $serverData[$i]['html_ve'] . '##VE_INFO##', $html);
156+
if(is_array($veInfo)) {
157+
foreach ($veInfo as $info) {
158+
for ($i = 0; $i < sizeof($serverData); $i++) {
159+
if ($serverData[$i]['server_name'] == $info['hostname']) {
160+
$html = str_replace('##VE_INFO##', $serverData[$i]['html_ve'] . '##VE_INFO##', $html);
161+
}
160162
}
161163
}
162164
}

server/plugins-available/shelluser_jailkit_plugin.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function delete($event_name,$data) {
160160
//exec('rm -rf '.$data['old']['dir'].$jailkit_chroot_userhome);
161161

162162
if(@is_dir($data['old']['dir'].$jailkit_chroot_userhome)) {
163-
$command = 'userdel -f';
163+
$command = 'userdel';
164164
$command .= ' '.escapeshellcmd($data['old']['username']);
165165
exec($command);
166166
$app->log("Jailkit Plugin -> delete chroot home:".$data['old']['dir'].$jailkit_chroot_userhome,LOGLEVEL_DEBUG);

0 commit comments

Comments
 (0)