Skip to content

Commit a29914f

Browse files
committed
Fixed: FS#536 - Adding Email Domain - Reseller sees all clients
1 parent b998c50 commit a29914f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

interface/web/mail/mail_domain_edit.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ function onShowEnd() {
7676
global $app, $conf;
7777

7878
if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
79-
// Getting Domains of the user
80-
$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0";
79+
// Getting Clients of the user
80+
if($_SESSION["s"]["user"]["typ"] == 'admin') {
81+
$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0";
82+
} else {
83+
$client_group_id = $_SESSION["s"]["user"]["default_group"];
84+
$sql = "SELECT client.client_id, limit_web_domain, default_webserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id";
85+
}
8186
$clients = $app->db->queryAllRecords($sql);
8287
$client_select = '';
8388
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";

0 commit comments

Comments
 (0)