Пример #1
0
         if (!$log->has_changed($record)) {
             continue;
         } else {
             $one_record_changed = true;
         }
         $edit_record = edit_record($record);
         if (false === $edit_record) {
             $error = true;
         } else {
             // Log the state after saving and write it to logging table
             $log->log_after($record['rid']);
             $log->write();
         }
     }
 }
 edit_zone_comment($_GET['id'], $_POST['comment']);
 if (false === $error) {
     update_soa_serial($_GET['id']);
     if ($one_record_changed) {
         success(SUC_ZONE_UPD);
     } else {
         success(SUC_ZONE_NOCHANGE);
     }
     if ($pdnssec_use) {
         if (dnssec_rectify_zone($_GET['id'])) {
             success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
         }
     }
 } else {
     error(ERR_ZONE_UPD);
 }
if (verify_permission('zone_meta_edit_others')) {
    $perm_meta_edit = "all";
} elseif (verify_permission('zone_meta_edit_own')) {
    $perm_meta_edit = "own";
} else {
    $perm_meta_edit = "none";
}
$zid = $_GET['domain'];
$user_is_zone_owner = verify_user_is_owner_zoneid($zid);
$zone_type = get_domain_type($zid);
$zone_name = get_zone_name_from_id($zid);
if (isset($_POST["commit"])) {
    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0") {
        error(ERR_PERM_EDIT_COMMENT);
    } else {
        edit_zone_comment($_GET['domain'], $_POST['comment']);
        success(SUC_COMMENT_UPD);
    }
}
echo "    <h2>" . _('Edit comment in zone') . " " . $zone_name . "</h2>\n";
if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
    error(ERR_PERM_VIEW_COMMENT);
} else {
    $comment = get_zone_comment($zid);
    echo "     <form method=\"post\" action=\"edit_comment.php?domain=" . $zid . "\">\n";
    echo "      <table>\n";
    echo "      <tr>\n";
    echo "       <td colspan=\"6\">&nbsp;</td>\n";
    echo "      </tr>\n";
    echo "      <tr>\n";
    echo "       <td>&nbsp;</td><td colspan=\"5\">Comments:</td>\n";