Skip to content

Commit cdf6f03

Browse files
committed
Fixed: FS#1496 - sites_web_domain_add creates new site in client0 group.
1 parent c6a89c8 commit cdf6f03

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,17 @@ public function sites_web_domain_add($session_id, $client_id, $params, $readonly
13421342
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
13431343
return false;
13441344
}
1345+
1346+
if(!isset($params['client_group_id']) or (isset($params['client_group_id']) && empty($params['client_group_id']))) {
1347+
$rec = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".intval($client_id));
1348+
$params['client_group_id'] = $rec['groupid'];
1349+
}
1350+
1351+
//* Set a few params to "not empty" values which get overwritten by the sites_web_domain_plugin
1352+
if($params['document_root'] == '') $params['document_root'] = '-';
1353+
if($params['system_user'] == '') $params['system_user'] = '-';
1354+
if($params['system_group'] == '') $params['system_group'] = '-';
1355+
13451356
$domain_id = $this->insertQuery('../sites/form/web_domain.tform.php',$client_id,$params, 'sites:web_domain:on_after_insert');
13461357
if ($readonly === true)
13471358
$app->db->query("UPDATE web_domain SET `sys_userid` = '1' WHERE domain_id = ".$domain_id);

0 commit comments

Comments
 (0)