$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");