From 2eb5d1be554dc85a0695babf08188fdfc5a4ee5f Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Fri, 23 Sep 2011 06:33:41 -0400
Subject: [PATCH] - Cleaned up JavaScript code. - Fix: IPv6 address must not be '*'.
---
interface/web/sites/ajax_get_ip.php | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/interface/web/sites/ajax_get_ip.php b/interface/web/sites/ajax_get_ip.php
index 57e5b77..8b2ee09 100644
--- a/interface/web/sites/ajax_get_ip.php
+++ b/interface/web/sites/ajax_get_ip.php
@@ -31,24 +31,27 @@
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
-// Checking module permissions
-if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
- header("Location: ../index.php");
- exit;
-}
+//* Check permissions for module
+$app->auth->check_module_permissions('sites');
$server_id = intval($_GET["server_id"]);
+$client_group_id = intval($_GET["client_group_id"]);
+$ip_type = $app->db->quote($_GET['ip_type']);
if($_SESSION["s"]["user"]["typ"] == 'admin') {
- $sql = "SELECT ip_address FROM server_ip WHERE server_id = $server_id";
+ $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 = "*";
+ } else {
+ $ip_select = "";
+ }
if(is_array($ips)) {
foreach( $ips as $ip) {
//$selected = ($ip["ip_address"] == $this->dataRecord["ip_address"])?'SELECTED':'';
- $ip_select .= "<option value='$ip[ip_address]'>$ip[ip_address]</option>\r\n";
+ $ip_select .= "#$ip[ip_address]";
}
}
unset($tmp);
--
Gitblit v1.9.1