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/plugins-available/apache2_plugin.inc.php |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 61202c6..0ee377f 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -1085,7 +1085,6 @@
 		$changed = false;
 		$in = fopen($filename, 'r');
 		$output = '';
-
 		/*
 		 * read line by line and search for the username and authname
 		*/
@@ -1096,10 +1095,9 @@
 				/*
 				 * found the user. delete or change it?
 				*/
-				if ($pwd != '') {
-					$tmp[2] = $pwdhash;
-					$output .= $tmp[0] . ':' . $tmp[1] . ':' . $tmp[2] . "\n";
-				}
+				if ($pwdhash != '') {
+					$output .= $tmp[0] . ':' . $tmp[1] . ':' . $pwdhash . "\n";
+					}
 				$changed = true;
 			}
 			else {
@@ -1110,7 +1108,7 @@
 		 * if we didn't change anything, we have to add the new user at the end of the file
 		*/
 		if (!$changed) {
-			$output .= $username . ':' . $authname . ':' . md5($username . ':' . $authname . ':' . $pwd) . "\n";
+			$output .= $username . ':' . $authname . ':' . $pwdhash . "\n";
 		}
 		fclose($in);
 

--
Gitblit v1.9.1