Author: jfthomps
Date: Tue Dec  9 18:12:53 2014
New Revision: 1644138

URL: http://svn.apache.org/r1644138
Log:
VCL-174 - NAT - support for sites that have small IP address ranges

utils.php: modified getRequestInfo and getComputers: changed to reference 
nathostcomputermap table instead of natmap table

computer.php: modified AJsaveResource, addResource, and AJsubmitCompNATchange: 
changed to reference nathostcomputermap table instead of natmap table

Modified:
    vcl/trunk/web/.ht-inc/computer.php
    vcl/trunk/web/.ht-inc/utils.php

Modified: vcl/trunk/web/.ht-inc/computer.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/computer.php?rev=1644138&r1=1644137&r2=1644138&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/computer.php (original)
+++ vcl/trunk/web/.ht-inc/computer.php Tue Dec  9 18:12:53 2014
@@ -846,7 +846,7 @@ class Computer extends Resource {
                        # NAT
                        if($data['natenabled'] != $olddata['natenabled']) {
                                if($data['natenabled']) {
-                                       $query = "INSERT INTO natmap "
+                                       $query = "INSERT INTO 
nathostcomputermap "
                                               .        "(computerid, "
                                               .        "nathostid) "
                                               . "VALUES ({$data['rscid']}, "
@@ -854,14 +854,14 @@ class Computer extends Resource {
                                        doQuery($query);
                                }
                                else {
-                                       $query = "DELETE FROM natmap "
+                                       $query = "DELETE FROM 
nathostcomputermap "
                                               . "WHERE computerid = 
{$data['rscid']}";
                                        doQuery($query);
                                }
                        }
                        elseif($data['natenabled'] &&
                           $olddata['nathostid'] != $data['nathostid']) {
-                               $query = "UPDATE natmap "
+                               $query = "UPDATE nathostcomputermap "
                                       . "SET nathostid = {$data['nathostid']} "
                                       . "WHERE computerid = {$data['rscid']}";
                                doQuery($query);
@@ -2131,7 +2131,7 @@ class Computer extends Resource {
 
                        # NAT
                        if($data['natenabled']) {
-                               $query = "INSERT INTO natmap "
+                               $query = "INSERT INTO nathostcomputermap "
                                       .        "(computerid, "
                                       .        "nathostid) "
                                       . "VALUES ($rscid, "
@@ -2196,7 +2196,7 @@ class Computer extends Resource {
 
                                # NAT
                                if($data['natenabled']) {
-                                       $query = "INSERT INTO natmap "
+                                       $query = "INSERT INTO 
nathostcomputermap "
                                               .        "(computerid, "
                                               .        "nathostid) "
                                               . "VALUES ($rscid, "
@@ -4374,11 +4374,11 @@ class Computer extends Resource {
                $compids = getContinuationVar('compids');
 
                $allids = implode(',', $compids);
-               $query = "DELETE FROM natmap "
+               $query = "DELETE FROM nathostcomputermap "
                       . "WHERE computerid IN ($allids)";
                doQuery($query);
                if($natenabled) {
-                       $query = "INSERT INTO natmap "
+                       $query = "INSERT INTO nathostcomputermap "
                               . "SELECT id, "
                               .        "$nathostid "
                               . "FROM computer "

Modified: vcl/trunk/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/utils.php?rev=1644138&r1=1644137&r2=1644138&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/utils.php (original)
+++ vcl/trunk/web/.ht-inc/utils.php Tue Dec  9 18:12:53 2014
@@ -5478,7 +5478,7 @@ function getRequestInfo($id, $returnNULL
               .      "imagerevision ir, "
               .      "OS o, "
               .      "computer c "
-              . "LEFT JOIN natmap n ON (c.id = n.computerid) "
+              . "LEFT JOIN nathostcomputermap n ON (c.id = n.computerid) "
               . "LEFT JOIN nathost nh ON (n.nathostid = nh.id) "
               . "WHERE rs.requestid = $id AND "
               .       "rs.imageid = i.id AND "
@@ -8230,7 +8230,7 @@ function getComputers($sort=0, $included
               . "LEFT JOIN computer c2 ON (c2.id = vh.computerid) "
               . "LEFT JOIN image next ON (c.nextimageid = next.id) "
               . "LEFT JOIN provisioning pr ON (c.provisioningid = pr.id) "
-              . "LEFT JOIN natmap nm ON (nm.computerid = c.id) "
+              . "LEFT JOIN nathostcomputermap nm ON (nm.computerid = c.id) "
               . "LEFT JOIN nathost nh ON (nm.nathostid = nh.id) "
               . "WHERE c.stateid = st.id AND "
               .       "c.platformid = p.id AND "


Reply via email to