From 0d3e95814c9b0dc5d1339d38c23cd7ab33a2e7a9 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Thu, 16 Jun 2016 08:43:08 -0400
Subject: [PATCH] Fixed Issue #3966 Error when Web-IP is '*'
---
interface/web/sites/ajax_get_ip.php | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/interface/web/sites/ajax_get_ip.php b/interface/web/sites/ajax_get_ip.php
index 205be48..8c83191 100644
--- a/interface/web/sites/ajax_get_ip.php
+++ b/interface/web/sites/ajax_get_ip.php
@@ -39,13 +39,15 @@
$client_group_id = $app->functions->intval($_GET["client_group_id"]);
$ip_type = $_GET['ip_type'];
-if($_SESSION["s"]["user"]["typ"] == 'admin' or $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
+//if($_SESSION["s"]["user"]["typ"] == 'admin' or $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
//* Get global web config
$web_config = $app->getconf->get_server_config($server_id, 'web');
+
+ $tmp = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE groupid = ?", $client_group_id);
+ $sql = "SELECT ip_address FROM server_ip WHERE ip_type = ? AND server_id = ? AND (client_id = 0 OR client_id=?)";
- $sql = "SELECT ip_address FROM server_ip WHERE ip_type = ? AND server_id = ?";
- $ips = $app->db->queryAllRecords($sql, $ip_type, $server_id);
+ $ips = $app->db->queryAllRecords($sql, $ip_type, $server_id, $tmp['groupid']);
// $ip_select = "<option value=''></option>";
if($ip_type == 'IPv4'){
$ip_select = ($web_config['enable_ip_wildcard'] == 'y')?"*#":"";
@@ -60,7 +62,7 @@
}
unset($tmp);
unset($ips);
-}
+//}
echo substr($ip_select, 0, -1);
?>
--
Gitblit v1.9.1