From e28564dbde4f922a6a8263e3dea32d56b60b5b5b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 16 Jun 2010 11:41:46 -0400
Subject: [PATCH] Implemented: FS#468 - Client name conversion in FTP user too restricted

---
 server/lib/classes/system.inc.php |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/server/lib/classes/system.inc.php b/server/lib/classes/system.inc.php
index 8d62ef1..260c214 100644
--- a/server/lib/classes/system.inc.php
+++ b/server/lib/classes/system.inc.php
@@ -464,6 +464,28 @@
 	  	return false;
 	}
 	
+	/*
+	// Alternative implementation of the is_group function. Should be faster then the old one To be tested.
+	function is_group($group) {
+	$groupfile = '/etc/group';
+	if(is_file($groupfile)) {
+		$handle = fopen ($groupfile, "r");
+		while (!feof($handle)) {
+			$line = trim(fgets($handle, 4096));
+			if($line != ""){
+				$parts = explode(":", $line);
+	        	if($parts[0] == $group) {
+					fclose ($handle);
+					return true;
+				}
+			}
+		}
+		fclose ($handle);
+	}
+	return false;
+	}
+	*/
+	
 	function root_group(){
 		global $app;
 	  	$group_datei = $this->server_conf["group_datei"];
@@ -1180,7 +1202,9 @@
 		
 		if($user != '' && $this->is_user($user) && $user != 'root') {
 			$user = escapeshellarg($user);
-			exec("chown $user $dir $dir_cur $dir_new $dir_tmp");
+			// I assume that the name of the (vmail group) is the same as the name of the mail user in ispconfig 3
+			$group = $user;
+			exec("chown $user:$group $dir $dir_cur $dir_new $dir_tmp");
 		}
 		
 		//* Add the subfolder to the subscriptions and courierimapsubscribed files

--
Gitblit v1.9.1