Example #1
0
     setHostOption($subnet, $hostname, "host-name", $hostname);
     if (isset($_POST["dnsrecord"])) {
         $options = getSubnetOptions(getSubnet($subnet));
         if (isset($options["primarydomainname"])) {
             addRecordA($options["primarydomainname"], $hostname, $ipaddress);
         }
     }
 }
 setHostOption($subnet, $hostname, "root-path", $rootpath);
 setHostOption($subnet, $hostname, "tftp-server-name", $tftpservername);
 setHostStatement($subnet, $hostname, "filename", $filename);
 setHostStatement($subnet, $hostname, "next-server", $nextserver);
 setHostHWAddress($subnet, $hostname, $macaddress);
 setHostStatement($subnet, $hostname, "fixed-address", $ipaddress);
 if ($updatednsrecord) {
     modifyRecord($zone, $hostname, $ipaddress);
 }
 // Display result message
 if (!isXMLRPCError()) {
     if (isset($_POST["badd"])) {
         $result .= _T("Host successfully added.");
     } else {
         $result .= _T("Host successfully modified.");
     }
     if ($updatednsrecord) {
         $result .= "<br>" . _T("DNS record successfully modified.");
     }
     new NotifyWidgetSuccess($result);
     header("Location: " . urlStrRedirect("network/network/subnetmembers", array("subnet" => $subnet)));
     exit;
 }
Example #2
0
    if (!isset($error)) {
        if (isset($_POST["badd"])) {
            addHostToSubnet($subnet, $hostname);
            setHostOption($subnet, $hostname, "host-name", $hostname);
            if (isset($_POST["dnsrecord"])) {
                $options = getSubnetOptions(getSubnet($subnet));
                if (isset($options["primarydomainname"])) addRecordA($options["primarydomainname"], $hostname, $ipaddress);
            }
        }
        setHostOption($subnet, $hostname, "root-path", $rootpath);
        setHostOption($subnet, $hostname, "tftp-server-name", $tftpservername);
        setHostStatement($subnet, $hostname, "filename", $filename);
        setHostStatement($subnet, $hostname, "next-server", $nextserver);
        setHostHWAddress($subnet, $hostname, $macaddress);
        setHostStatement($subnet, $hostname, "fixed-address", $ipaddress);
        if ($updatednsrecord) modifyRecord($zone, $hostname, $ipaddress);
        // Display result message
        if (!isXMLRPCError()) {
            if (isset($_POST["badd"])) $result .= _T("Host successfully added.");
            else $result .= _T("Host successfully modified.");
            if ($updatednsrecord) $result .= "<br>" . _T("DNS record successfully modified.");
            new NotifyWidgetSuccess($result);
            header("Location: " . urlStrRedirect("network/network/subnetmembers", array("subnet" => $subnet)));
            exit;
        }
    } else new NotifyWidgetFailure($error);
}

if ($_GET["action"] == "subnetedithost") {
    $hostname = $_GET["host"];
    $host = getHost($subnet, $hostname);