Skip to content

Commit 11faaac

Browse files
committed
Fixed: FS#879 - Reseller cannot create database for himself, only for "c0" or subclients.
1 parent d4eae9f commit 11faaac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

interface/web/sites/database_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function onShowEnd() {
8585

8686
// Get the limits of the client
8787
$client_group_id = $_SESSION["s"]["user"]["default_group"];
88-
$client = $app->db->queryOneRecord("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");
88+
$client = $app->db->queryOneRecord("SELECT client.client_id, limit_web_domain, default_webserver, contact_name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
8989

9090
// Set the webserver to the default server of the client
9191
$tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = $client[default_webserver]");
@@ -95,7 +95,7 @@ function onShowEnd() {
9595
// Fill the client select field
9696
$sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id'];
9797
$clients = $app->db->queryAllRecords($sql);
98-
$client_select = '';
98+
$client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>';
9999
if(is_array($clients)) {
100100
foreach( $clients as $client) {
101101
$selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';

interface/web/sites/web_domain_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ function onShowEnd() {
115115
$clients = $app->db->queryAllRecords($sql);
116116
$client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>';
117117
if(is_array($clients)) {
118-
foreach( $clients as $c) {
119-
$selected = @($c["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
118+
foreach( $clients as $client) {
119+
$selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
120120
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
121121
}
122122
}

0 commit comments

Comments
 (0)