Skip to content

Commit e79866f

Browse files
author
marknl
committed
FS#1113 - Force client to use only allowed IPs - see flyspray page for more info
1 parent 55fee88 commit e79866f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

interface/web/sites/web_domain_edit.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function onShowNew() {
8282
function onShowEnd() {
8383
global $app, $conf;
8484

85-
//* Client: If the logged in user is not admin and has no sub clients (no rseller)
85+
//* Client: If the logged in user is not admin and has no sub clients (no reseller)
8686
if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) {
8787

8888
// Get the limits of the client
@@ -95,9 +95,7 @@ function onShowEnd() {
9595
unset($tmp);
9696

9797
// Fill the IP select field with the IP addresses that are allowed for this client
98-
// $ip_select = "<option value='*'>*</option>";
99-
// $app->tpl->setVar("ip_address",$ip_select);
100-
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver'];
98+
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver']." AND client_id=0 OR client_id=".$_SESSION['s']['user']['client_id'];
10199
$ips = $app->db->queryAllRecords($sql);
102100
$ip_select = "<option value='*'>*</option>";
103101
//$ip_select = "";
@@ -111,7 +109,7 @@ function onShowEnd() {
111109
unset($tmp);
112110
unset($ips);
113111

114-
//* Reseller: If the logged in user is not admin and has sub clients (is a rseller)
112+
//* Reseller: If the logged in user is not admin and has sub clients (is a reseller)
115113
} elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
116114

117115
// Get the limits of the client
@@ -138,9 +136,7 @@ function onShowEnd() {
138136
$app->tpl->setVar("client_group_id",$client_select);
139137

140138
// Fill the IP select field with the IP addresses that are allowed for this client
141-
//$ip_select = "<option value='*'>*</option>";
142-
//$app->tpl->setVar("ip_address",$ip_select);
143-
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver'];
139+
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$client['default_webserver']." AND client_id=0 OR client_id=".$_SESSION['s']['user']['client_id'];
144140
$ips = $app->db->queryAllRecords($sql);
145141
$ip_select = "<option value='*'>*</option>";
146142
//$ip_select = "";

0 commit comments

Comments
 (0)