Exemplo n.º 1
0
    change_zone_type($_POST['newtype'], $zone_id);
}
if (isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"])) {
    add_owner_to_zone($_POST["domain"], $_POST["newowner"]);
}
if (isset($_POST["delete_owner"]) && is_numeric($_POST["delete_owner"])) {
    delete_owner_from_zone($zone_id, $_POST["delete_owner"]);
}
if (isset($_POST["template_change"])) {
    if (!isset($_POST['zone_template']) || "none" == $_POST['zone_template']) {
        $new_zone_template = 0;
    } else {
        $new_zone_template = $_POST['zone_template'];
    }
    if ($_POST['current_zone_template'] != $new_zone_template) {
        update_zone_records($zone_id, $new_zone_template);
    }
}
if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
    error(ERR_PERM_VIEW_ZONE);
    include_once "inc/footer.inc.php";
    exit;
}
if (zone_id_exists($zone_id) == "0") {
    error(ERR_ZONE_NOT_EXIST);
    include_once "inc/footer.inc.php";
    exit;
}
if (isset($_POST['sign_zone'])) {
    $zone_name = get_zone_name_from_id($zone_id);
    update_soa_serial($zone_id);
    if (zone_templ_name_exists($_POST['templ_name'])) {
        error(ERR_ZONE_TEMPL_EXIST);
    } elseif ($_POST['templ_name'] == '') {
        error(ERR_ZONE_TEMPL_IS_EMPTY);
    } else {
        success(SUC_ZONE_TEMPL_ADD);
        $templ_details = get_zone_templ_details($zone_templ_id);
        add_zone_templ_save_as($_POST['templ_name'], $_POST['templ_descr'], $_SESSION['userid'], $_POST['record']);
    }
}
if (isset($_POST['update_zones'])) {
    $records = get_zone_templ_records($zone_templ_id);
    $zones = get_list_zone_use_templ($zone_templ_id, $_SESSION['userid']);
    success(SUC_ZONES_UPD);
    foreach ($zones as $zone) {
        update_zone_records($zone['id'], $zone_templ_id);
    }
}
if (!verify_permission('zone_master_add') || !$owner) {
    error(ERR_PERM_EDIT_ZONE_TEMPL);
} else {
    if (zone_templ_id_exists($zone_templ_id) == "0") {
        error(ERR_ZONE_TEMPL_NOT_EXIST);
    } else {
        $record_count = count_zone_templ_records($zone_templ_id);
        $templ_details = get_zone_templ_details($zone_templ_id);
        echo "   <h2>" . _('Edit zone template') . " \"" . $templ_details['name'] . "\"</h2>\n";
        echo "   <div class=\"showmax\">\n";
        show_pages($record_count, $iface_rowamount, $zone_templ_id);
        echo "   </div>\n";
        $records = get_zone_templ_records($zone_templ_id, ROWSTART, $iface_rowamount, RECORD_SORT_BY);