From 3fc28c0142bf8ab4e2cfae44931e2a51aadc4d51 Mon Sep 17 00:00:00 2001 From: mcramer <m.cramer@pixcept.de> Date: Mon, 25 Feb 2013 13:51:37 -0500 Subject: [PATCH] - Added: remoting queries with a lot of results (e.g. email addresses or alias domains or dns rr) lead to non-functioning soap requests - added '#OFFSET#' AND '#LIMIT#' handling to the query - added automatic 'WHERE 1' if an empty array was given as query example: $result = $api->sites_web_domain_get('type' => 'vhost', '#OFFSET#' => 25, '#LIMIT#' => 50); to get the websites 26 to 75 --- interface/web/sites/ajax_get_ip.php | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/interface/web/sites/ajax_get_ip.php b/interface/web/sites/ajax_get_ip.php index 62d62e8..34fbab8 100644 --- a/interface/web/sites/ajax_get_ip.php +++ b/interface/web/sites/ajax_get_ip.php @@ -33,26 +33,34 @@ //* Check permissions for module $app->auth->check_module_permissions('sites'); +$app->uses('getconf'); -$server_id = intval($_GET["server_id"]); -$client_group_id = intval($_GET["client_group_id"]); +$server_id = $app->functions->intval($_GET["server_id"]); +$client_group_id = $app->functions->intval($_GET["client_group_id"]); $ip_type = $app->db->quote($_GET['ip_type']); -if($_SESSION["s"]["user"]["typ"] == 'admin') { +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'); + $sql = "SELECT ip_address FROM server_ip WHERE ip_type = '$ip_type' AND server_id = $server_id"; $ips = $app->db->queryAllRecords($sql); // $ip_select = "<option value=''></option>"; - $ip_select = "*"; + if($ip_type == 'IPv4'){ + $ip_select = ($web_config['enable_ip_wildcard'] == 'y')?"*#":""; + } else { + $ip_select = "#"; + } if(is_array($ips)) { foreach( $ips as $ip) { //$selected = ($ip["ip_address"] == $this->dataRecord["ip_address"])?'SELECTED':''; - $ip_select .= "#$ip[ip_address]"; + $ip_select .= "$ip[ip_address]#"; } } unset($tmp); unset($ips); } -echo $ip_select; +echo substr($ip_select,0,-1); ?> \ No newline at end of file -- Gitblit v1.9.1