示例#1
0
 $hostname = $_POST["hostname"];
 $ipaddress = $_POST["ipaddress"];
 /* Basic checks */
 if (hostExists($zone, $hostname)) {
     $error = _T("The specified hostname has been already recorded in this zone.") . " ";
     setFormError("hostname");
     $hostname = "";
 }
 if (ipExists($zone, $ipaddress)) {
     $error .= _T("The specified IP address has been already recorded in this zone.");
     setFormError("address");
 } else {
     $keepaddress = True;
 }
 if (!isset($error)) {
     $ret = addRecordA($zone, $hostname, $ipaddress);
     if (!isXMLRPCError()) {
         if ($ret === 1) {
             $msg = _T("Host successfully added to DNS zone.");
         } else {
             $msg = _T("Host successfully added to DNS zone and corresponding reverse zone.");
         }
         new NotifyWidgetSuccess($msg);
         if (isset($_GET["gobackto"])) {
             header("Location: " . $_SERVER["PHP_SELF"] . "?" . rawurldecode($_GET["gobackto"]));
         } else {
             header("Location: " . urlStrRedirect("network/network/zonemembers", array("zone" => $zone)));
         }
         exit;
     }
 } else {
示例#2
0
                     } else {
                         $updatednsrecord = True;
                     }
                 }
             }
         }
     }
 }
 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"])) {