Beispiel #1
0
if ($zone_id == "-1") {
    error(ERR_INV_INPUT);
    include_once "inc/footer.inc.php";
    exit;
}
echo "     <h2>" . _('Delete zone') . " \"" . $zone_info['name'] . "\"</h2>\n";
if ($confirm == '1') {
    if (delete_domain($zone_id)) {
        success(SUC_ZONE_DEL);
    }
} else {
    if ($perm_edit == "all" || $perm_edit == "own" && $user_is_zone_owner == "1") {
        echo "      " . _('Owner') . ": " . $zone_owners . "<br>\n";
        echo "      " . _('Type') . ": " . $zone_info['type'] . "\n";
        if ($zone_info['type'] == "SLAVE") {
            $slave_master = get_domain_slave_master($zone_id);
            if (supermaster_exists($slave_master)) {
                echo "        <p>         \n";
                printf(_('You are about to delete a slave zone of which the master nameserver, %s, is a supermaster. Deleting the zone now, will result in temporary removal only. Whenever the supermaster sends a notification for this zone, it will be added again!'), $slave_master);
                echo "        </p>\n";
            }
        }
        echo "     <p>" . _('Are you sure?') . "</p>\n";
        echo "     <br><br>\n";
        echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='" . $_SERVER["REQUEST_URI"] . "&confirm=1'\" value=\"" . _('Yes') . "\">\n";
        echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
    } else {
        error(ERR_PERM_DEL_ZONE);
    }
}
include_once "inc/footer.inc.php";
Beispiel #2
0
function add_supermaster($master_ip, $ns_name, $account)
{
    global $db;
    if (!is_valid_ipv4($master_ip) && !is_valid_ipv6($master_ip)) {
        error(ERR_DNS_IP);
        return false;
    }
    if (!is_valid_hostname_fqdn($ns_name, 0)) {
        error(ERR_DNS_HOSTNAME);
        return false;
    }
    if (!validate_account($account)) {
        error(sprintf(ERR_INV_ARGC, "add_supermaster", "given account name is invalid (alpha chars only)"));
        return false;
    }
    if (supermaster_exists($master_ip)) {
        error(ERR_SM_EXISTS);
        return false;
    } else {
        $db->query("INSERT INTO supermasters VALUES (" . $db->quote($master_ip, 'text') . ", " . $db->quote($ns_name, 'text') . ", " . $db->quote($account, 'text') . ")");
        return true;
    }
}