moved some functionality into the ip class
[PHPIPManager.git] / lib / www.php
index 79409a8..2ec7c73 100644 (file)
@@ -123,10 +123,9 @@ function www_ip_addSuperRange()
        $mask = $_REQUEST["mask"];
        $desc = $_REQUEST["desc"];
        
-       if(ip::isValid($sn, $mask)) {
-               $sn = ip::truncateNetwork($sn, $mask);
-               $sql = "insert into supernet values (NULL, '$name', '$sn', '$mask', '$desc')";
-               $db->dbobject->query($sql);
+       $myip = new ip();
+       
+       if($myip->addSupernet($name, $sn, $mask, $desc)) {
                header("Location: index.php?notice=range added");
        } else {
                header("Location: index.php?error=invalid ipaddress");