예제 #1
0
function netearthone_GetDNS($params)
{
    return resellerclub_GetDNS($params);
}
예제 #2
0
function stargate_GetDNS($params)
{
    return resellerclub_GetDNS($params);
}
예제 #3
0
function resellerclub_SaveDNS($params)
{
    $testmode = $params['TestMode'];
    $tld = $params['tld'];
    $sld = $params['sld'];
    $postfields = array();
    $postfields['auth-userid'] = $params['ResellerID'];
    $postfields['api-key'] = $params['APIKey'];
    $postfields['domain-name'] = $params['sld'] . "." . $params['tld'];
    $hostrecords = resellerclub_GetDNS($params);
    $newrecords = $params['dnsrecords'];
    foreach ($newrecords as $num => $newvalues) {
        $oldvalues = $hostrecords[$num];
        $oldhostname = $oldvalues['hostname'];
        $oldtype = $oldvalues['type'];
        $oldaddress = $oldvalues['address'];
        $oldpriority = $oldvalues['priority'];
        $newhostname = $newvalues['hostname'];
        $newtype = $newvalues['type'];
        $newaddress = $newvalues['address'];
        $newpriority = $newvalues['priority'];
        if ($newpriority == "N/A") {
            $newpriority = "";
        }
        if (!$newhostname || !$newaddress) {
            if ($oldhostname && $oldaddress) {
                if ($oldtype != "URL" && $oldtype != "FRAME") {
                    $postfields['host'] = $oldhostname;
                    $postfields['value'] = $oldaddress;
                    $result = resellerclub_SendCommand("delete-record", "dns/manage", $postfields, $params, "POST");
                    continue;
                }
                $orderid = resellerclub_getOrderID($postfields, $params);
                $postfields['order-id'] = $orderid;
                $postfields['url-masking'] = "false";
                $postfields['sub-domain-forwarding'] = "false";
                $postfields['path-forwarding'] = "false";
                $postfields['forward-to'] = "";
                $result = resellerclub_SendCommand("manage", "domainforward", $postfields, $params, "POST");
                continue;
            }
            continue;
        }
        if ($oldhostname != $newhostname || $oldtype != $newtype || $oldaddress != $newaddress || $type == "MX" && $oldpriority != $newpriority) {
            $postfields['host'] = $newhostname;
            $ltype = strtolower($newtype);
            if ($ltype == "a") {
                $ltype = "ipv4";
            }
            if ($ltype == "aaaa") {
                $ltype = "ipv6";
            }
            if ($ltype == "mx") {
                $postfields['priority'] = $newpriority;
            }
            if ($ltype == "url" || $ltype == "frame") {
                $orderid = resellerclub_getOrderID($postfields, $params);
                $postfields['order-id'] = $orderid;
                $result = resellerclub_SendCommand("activate", "domainforward", $postfields, $params, "POST");
                $postfields['url-masking'] = "true";
                $postfields['sub-domain-forwarding'] = "true";
                $postfields['path-forwarding'] = "true";
                $postfields['forward-to'] = html_entity_decode($newaddress);
                $result = resellerclub_SendCommand("manage", "domainforward", $postfields, $params, "POST");
            } else {
                if (in_array($ltype, array("ipv4", "ipv6", "cname", "mx", "ns", "txt", "srv", "soa"))) {
                    if (!$oldhostname && !$oldaddress) {
                        $postfields['value'] = $newaddress;
                        $result = resellerclub_SendCommand("add-" . $ltype . "-record", "dns/manage", $postfields, $params, "POST");
                    } else {
                        $postfields['current-value'] = html_entity_decode($oldaddress);
                        $postfields['new-value'] = html_entity_decode($newaddress);
                        $result = resellerclub_SendCommand("update-" . $ltype . "-record", "dns/manage", $postfields, $params, "POST");
                    }
                }
            }
            $error = false;
            if ($result['status'] == "Failed" || $result['status'] == "ERROR") {
                if (!$result['msg']) {
                    $result['msg'] == $result['message'];
                }
                $errormsgs[] = $newtype . "|" . $newhostname . "|" . $newaddress . " - " . $result['msg'];
                continue;
            }
            continue;
        }
    }
    if (count($errormsgs)) {
        return array("error" => implode("<br />", $errormsgs));
    }
    return array();
}
예제 #4
0
function resellercamp_GetDNS($params)
{
    return resellerclub_GetDNS($params);
}