From e6a2917b9de293e735df5dbf0b10dce967185f45 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 17 Apr 2013 10:35:00 -0400
Subject: [PATCH] Fix in ispconfig url detection function when nginx returns '_' as $_SERVER['SERVER_NAME']

---
 server/plugins-available/shelluser_base_plugin.inc.php |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php
index 6b4e18f..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

--
Gitblit v1.9.1