diff --git a/interface/web/sites/ftp_user_edit.php b/interface/web/sites/ftp_user_edit.php index 511ac907195a3e73b5a62504f437163d3f0ceed0..e286fab56f0bf315830b236569de5188f48766da 100644 --- a/interface/web/sites/ftp_user_edit.php +++ b/interface/web/sites/ftp_user_edit.php @@ -184,7 +184,7 @@ class page_action extends tform_actions { function getClientName() { global $app, $conf; - if($_SESSION["s"]["user"]["typ"] != 'admin') { + if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { // Get the group-id of the user $client_group_id = $_SESSION["s"]["user"]["default_group"]; } else { diff --git a/interface/web/sites/shell_user_edit.php b/interface/web/sites/shell_user_edit.php index 422c8a1b5e7a5dcda8c7e535472afdf4528ec864..c3102cd4399dcbc0f1c253140bfe65d9e758e8ab 100644 --- a/interface/web/sites/shell_user_edit.php +++ b/interface/web/sites/shell_user_edit.php @@ -198,7 +198,7 @@ class page_action extends tform_actions { function getClientName() { global $app, $conf; - if($_SESSION["s"]["user"]["typ"] != 'admin') { + if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { // Get the group-id of the user $client_group_id = $_SESSION["s"]["user"]["default_group"]; } else { diff --git a/interface/web/sites/tools.inc.php b/interface/web/sites/tools.inc.php index 81de9f6db56a36dd723ac6b155140dcbef5c82bf..d4e4c3efee334a56e4898a76394d4a583d7a1948 100644 --- a/interface/web/sites/tools.inc.php +++ b/interface/web/sites/tools.inc.php @@ -53,7 +53,7 @@ function replacePrefix($name, $dataRecord){ function getClientName($dataRecord) { global $app, $conf; - if($_SESSION["s"]["user"]["typ"] != 'admin') { + if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { // Get the group-id of the user $client_group_id = $_SESSION["s"]["user"]["default_group"]; } else { @@ -79,7 +79,7 @@ function getClientName($dataRecord) { function getClientID($dataRecord) { global $app, $conf; - if($_SESSION["s"]["user"]["typ"] != 'admin') { + if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { // Get the group-id of the user $client_group_id = $_SESSION["s"]["user"]["default_group"]; } else { diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php index a019b0495a2bc8bb745b9f894cc269beb43e56f5..1e197f96b9972be73e322186cade1495b3567f7f 100644 --- a/interface/web/sites/web_domain_edit.php +++ b/interface/web/sites/web_domain_edit.php @@ -254,7 +254,7 @@ class page_action extends tform_actions { $document_root = str_replace("[website_id]",$this->id,$web_config["website_path"]); // get the ID of the client - if($_SESSION["s"]["user"]["typ"] != 'admin') { + if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { $client_group_id = $_SESSION["s"]["user"]["default_group"]; $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = $client_group_id"); $client_id = intval($client["client_id"]); @@ -342,7 +342,7 @@ class page_action extends tform_actions { $client_id = intval($client["client_id"]); } - if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["client_group_id"]) { + if(($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) && isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["client_group_id"]) { // Set the values for document_root, system_user and system_group $system_user = 'web'.$this->id; $system_group = 'client'.$client_id;