예제 #1
0
        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 (isset($_POST['save_as'])) {
    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);
        $records = get_records_from_domain_id($zone_id);
        add_zone_templ_save_as($_POST['templ_name'], $_POST['templ_descr'], $_SESSION['userid'], $records, get_zone_name_from_id($zone_id));
    }
}
/*
 Check permissions
*/
if (do_hook('verify_permission', 'zone_content_view_others')) {
    $perm_view = "all";
} elseif (do_hook('verify_permission', 'zone_content_view_own')) {
예제 #2
0
/** Modify zone template
 *
 * @param mixed[] $details array of new zone template details
 * @param int $zone_templ_id zone template id
 *
 * @return boolean true on success, false otherwise
 */
function edit_zone_templ($details, $zone_templ_id)
{
    global $db;
    $zone_name_exists = zone_templ_name_exists($details['templ_name'], $zone_templ_id);
    if (!do_hook('verify_permission', 'zone_master_add')) {
        error(ERR_PERM_ADD_ZONE_TEMPL);
        return false;
    } elseif ($zone_name_exists != '0') {
        error(ERR_ZONE_TEMPL_EXIST);
        return false;
    } else {
        $query = "UPDATE zone_templ\n\t\t\tSET name=" . $db->quote($details['templ_name'], 'text') . ",\n\t\t\tdescr=" . $db->quote($details['templ_descr'], 'text') . "\n\t\t\tWHERE id=" . $db->quote($zone_templ_id, 'integer');
        $result = $db->query($query);
        if (PEAR::isError($result)) {
            error($result->getMessage());
            return false;
        }
        return true;
    }
}