From 8e65843f3c31c4f66f885b549eed47322849745b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 17 Nov 2008 09:49:15 -0500
Subject: [PATCH] FTP and Shell users belong to the same ispconfig group then the website they belong to.

---
 interface/web/sites/shell_user_edit.php    |    5 ++++-
 interface/web/dns/templates/dns_a_list.htm |    4 ++--
 interface/web/sites/ftp_user_edit.php      |    6 +++++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/interface/web/dns/templates/dns_a_list.htm b/interface/web/dns/templates/dns_a_list.htm
index c0dc4bf..fdfe122 100644
--- a/interface/web/dns/templates/dns_a_list.htm
+++ b/interface/web/dns/templates/dns_a_list.htm
@@ -49,11 +49,11 @@
           </tr>
           <tr>
             <td class="tbl_col_active"><select name="search_active" onChange="changeTab('dns_records','dns/dns_soa_edit.php');">{tmpl_var name='search_active'}</select></td>
-            <td class="tbl_col_type"><select name="search_server_id" onChange="changeTab('dns_records','dns/dns_soa_edit.php');">{tmpl_var name='search_type'}</select></td>
+            <td class="tbl_col_type"><select name="search_type" onChange="changeTab('dns_records','dns/dns_soa_edit.php');">{tmpl_var name='search_type'}</select></td>
             <td class="tbl_col_name"><input type="text" name="search_name" value="{tmpl_var name='search_name'}" /></td>
             <td class="tbl_col_data"><input type="text" name="search_data" value="{tmpl_var name='search_data'}" /></td>
             <td class="tbl_col_aux"><input type="text" name="search_aux" value="{tmpl_var name='search_aux'}" /></td>
-            <td class="tbl_col_buttons"><div class="buttons"><button type="button" class="icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="submitForm('pageForm','dns/dns_soa_edit.php');"><span>{tmpl_var name="filter_txt"}</span></button></div></td>
+            <td class="tbl_col_buttons"><div class="buttons"><button type="button" class="icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="changeTab('dns_records','dns/dns_soa_edit.php');"><span>{tmpl_var name="filter_txt"}</span></button></div></td>
           </tr>
         </thead>
         <tbody>
diff --git a/interface/web/sites/ftp_user_edit.php b/interface/web/sites/ftp_user_edit.php
index 31bf0aa..3452935 100644
--- a/interface/web/sites/ftp_user_edit.php
+++ b/interface/web/sites/ftp_user_edit.php
@@ -93,9 +93,13 @@
 		$uid = $web["system_user"];
 		$gid = $web["system_group"];
 		
-		$sql = "UPDATE ftp_user SET server_id = $server_id, dir = '$dir', uid = '$uid', gid = '$gid' WHERE ftp_user_id = ".$this->id;
+		// The FTP user shall be owned by the same group then the website
+		$sys_groupid = $web['sys_groupid'];
+		
+		$sql = "UPDATE ftp_user SET server_id = $server_id, dir = '$dir', uid = '$uid', gid = '$gid', sys_groupid = '$sys_groupid' WHERE ftp_user_id = ".$this->id;
 		$app->db->query($sql);
 		
+		
 	}
 	
 	function onAfterUpdate() {
diff --git a/interface/web/sites/shell_user_edit.php b/interface/web/sites/shell_user_edit.php
index f7189f0..17e55a9 100644
--- a/interface/web/sites/shell_user_edit.php
+++ b/interface/web/sites/shell_user_edit.php
@@ -104,7 +104,10 @@
 		$puser = $web["system_user"];
 		$pgroup = $web["system_group"];
 		
-		$sql = "UPDATE shell_user SET server_id = $server_id, dir = '$dir', puser = '$puser', pgroup = '$pgroup' WHERE shell_user_id = ".$this->id;
+		// The FTP user shall be owned by the same group then the website
+		$sys_groupid = $web['sys_groupid'];
+		
+		$sql = "UPDATE shell_user SET server_id = $server_id, dir = '$dir', puser = '$puser', pgroup = '$pgroup', sys_groupid = '$sys_groupid' WHERE shell_user_id = ".$this->id;
 		$app->db->query($sql);
 		
 	}

--
Gitblit v1.9.1