Skip to content

Commit 8e65843

Browse files
committed
FTP and Shell users belong to the same ispconfig group then the website they belong to.
1 parent 83df1d0 commit 8e65843

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

interface/web/dns/templates/dns_a_list.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
</tr>
5050
<tr>
5151
<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>
52-
<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>
52+
<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>
5353
<td class="tbl_col_name"><input type="text" name="search_name" value="{tmpl_var name='search_name'}" /></td>
5454
<td class="tbl_col_data"><input type="text" name="search_data" value="{tmpl_var name='search_data'}" /></td>
5555
<td class="tbl_col_aux"><input type="text" name="search_aux" value="{tmpl_var name='search_aux'}" /></td>
56-
<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>
56+
<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>
5757
</tr>
5858
</thead>
5959
<tbody>

interface/web/sites/ftp_user_edit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,13 @@ function onAfterInsert() {
9393
$uid = $web["system_user"];
9494
$gid = $web["system_group"];
9595

96-
$sql = "UPDATE ftp_user SET server_id = $server_id, dir = '$dir', uid = '$uid', gid = '$gid' WHERE ftp_user_id = ".$this->id;
96+
// The FTP user shall be owned by the same group then the website
97+
$sys_groupid = $web['sys_groupid'];
98+
99+
$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;
97100
$app->db->query($sql);
98101

102+
99103
}
100104

101105
function onAfterUpdate() {

interface/web/sites/shell_user_edit.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ function onAfterInsert() {
104104
$puser = $web["system_user"];
105105
$pgroup = $web["system_group"];
106106

107-
$sql = "UPDATE shell_user SET server_id = $server_id, dir = '$dir', puser = '$puser', pgroup = '$pgroup' WHERE shell_user_id = ".$this->id;
107+
// The FTP user shall be owned by the same group then the website
108+
$sys_groupid = $web['sys_groupid'];
109+
110+
$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;
108111
$app->db->query($sql);
109112

110113
}

0 commit comments

Comments
 (0)