From 6508d0c5b766fe56e96741a61ab7a1ece4191f2d Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Fri, 17 May 2013 12:09:10 -0400
Subject: [PATCH] - Possible Fix for:  FS#2918 - multiserver - remote access db passwd not changed , when changed access from IP to % and vice versa 

---
 server/plugins-available/shelluser_base_plugin.inc.php |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php
index 48e2cde..2924d49 100755
--- a/server/plugins-available/shelluser_base_plugin.inc.php
+++ b/server/plugins-available/shelluser_base_plugin.inc.php
@@ -114,7 +114,7 @@
 				
 				//* Disable shell user temporarily if we use jailkit
 				if($data['new']['chroot'] == 'jailkit') {
-					$command = 'usermod -s /bin/false -L '.escapeshellcmd($data['new']['username']);
+					$command = 'usermod -s /bin/false -L '.escapeshellcmd($data['new']['username']).' 2>/dev/null';
 					exec($command);
 					$app->log("Disabling shelluser temporarily: ".$command,LOGLEVEL_DEBUG);
 				}
@@ -162,8 +162,8 @@
 					exec($command);
 					$app->log("Executed command: $command ",LOGLEVEL_DEBUG);
 					*/
-					$groupinfo = posix_getgrnam($data['new']['pgroup']);
-					$app->system->usermod($data['old']['username'],0, $groupinfo[gid], $data['new']['dir'], $data['new']['shell'], $data['new']['password'], $data['new']['username']);
+					//$groupinfo = $app->system->posix_getgrnam($data['new']['pgroup']);
+					$app->system->usermod($data['old']['username'],0, $app->system->getgid($data['new']['pgroup']), $data['new']['dir'], $data['new']['shell'], $data['new']['password'], $data['new']['username']);
 					$app->log("Updated shelluser: ".$data['old']['username'],LOGLEVEL_DEBUG);
 									
 					// call the ssh-rsa update function
@@ -204,8 +204,7 @@
 				// We delete only non jailkit users, jailkit users will be deleted by the jailkit plugin.
 				if ($data['old']['chroot'] != "jailkit") {
 					$command = 'userdel -f';
-					$command .= ' '.escapeshellcmd($data['old']['username']);
-			
+					$command .= ' '.escapeshellcmd($data['old']['username']).' &> /dev/null';
 					exec($command);
 					$app->log("Deleted shelluser: ".$data['old']['username'],LOGLEVEL_DEBUG);
 				}

--
Gitblit v1.9.1