예제 #1
0
    }
    if (sprintf("%04u%02u%02u", $expireyear, $expiremonth, $expireday) >= sprintf("%04u%02u%02u", $regyear, $regmonth, $regday) and sprintf("%04u%02u%02u", $regyear, $regmonth, $regday) >= sprintf("%04u%02u%02u", $createyear, $createmonth, $createday)) {
    } else {
        myError($w, $p, my_("Invalid date combination. Expire date must be greater than last registration date which must be greater than creation date"));
    }
    // use base template (for additional subnet information)
    $template = new IPplanIPTemplate("fwdzonetemplate", $cust);
    $info = "";
    if ($template->is_error() == FALSE) {
        // PROBLEM HERE: if template create suddenly returns error (template file
        // permissions, xml error etc), then each submit thereafter will erase
        // previous contents - this is not good
        $template->Merge($userfld);
        $err = $template->Verify($w);
        if ($template->is_blank() == FALSE) {
            $info = $template->encode();
        }
    }
}
// ##################### Start OF Add ##############################
if ($action == "add") {
    // loop through array - each element is a domain to add
    foreach ($muldomains as $domain) {
        $domain = trim($domain);
        $ds->SetForm($cust, $dataid, $domain);
        $ds->SetDate("{$createyear}-{$createmonth}-{$createday}", "{$expireyear}-{$expiremonth}-{$expireday}", "{$regyear}-{$regmonth}-{$regday}");
        $ds->SetSOA($hname, $ttl, $refresh, $retry, $expire, $minimum, $responsiblemail, $slaveonly, $zonepath, $seczonepath, $info);
        $ds->DbfTransactionStart();
        // dataid to create zone records will be available in $ds->dataid
        $ds->clone = $clone;
        $result = $ds->FwdAdd($cust, $domain, $server);