Пример #1
0
            }
        }
        $mz = new masterZone($gzone);
        $sz = new slaveZone($gzone);
        if ($mz->loadZoneHead() || $sz->loadZoneHead()) {
            $mz = array();
            $sz = array();
            problem("existzone");
        }
        $smarty->assign("zone", $gzone);
        $nz = new masterZone();
        if ($nz->parseZone($content, $zone, $user->getId()) && $nz->getId() > 0) {
            $smarty->assign("pagetitle", "Review imported records");
            $smarty->assign("template", "uploadreview.tpl");
            $smarty->assign("output", explode("\n", $nz->getConf($conf->hostMaster)));
            $smarty->assign("help", help("uploadreview"));
            $smarty->assign("menu_button", menu_buttons());
        } else {
            $smarty->assign("problem", explode("\n", $nz->getErr()));
            $smarty->assign("pagetitle", "Import error");
            $smarty->assign("template", "uploadproblem.tpl");
            $smarty->assign("help", help("uploadproblem"));
            $smarty->assign("menu_button", menu_buttons());
        }
        $smarty->display("main.tpl");
    } else {
        problem();
    }
} else {
    access_denied();
}
Пример #2
0
 $zone = new masterZone(array('id' => $znum));
 $zone->loadZone();
 $zonerec = $zone->getZoneHead();
 $currpage = isset($_GET['page']) && intval($_GET['page']) > 0 ? $currpage = intval($_GET['page']) : 1;
 $allrec = $zone->getRecords(true);
 $count = sizeof($allrec);
 $fromto = makePart($count, $currpage);
 $rec = array();
 for ($i = $fromto[0]; $i < $fromto[1]; $i++) {
     $allrec[$i]['ttl'] = $allrec[$i]['ttl'] > 0 ? $allrec[$i]['ttl'] : '';
     $rec[] = $allrec[$i];
 }
 $users = $user->getAllusers();
 $types = $conf->parameters;
 $err = '';
 $err .= !is_array($zonerec) || !is_array($rec) ? $zone->getErr() : '';
 $err .= !is_array($users) ? $user->getErr() : '';
 $err .= !is_array($types) ? "Record types not foud\n" : '';
 if ($err > '') {
     $smarty->assign("popuperror", implode("<br />", explode("\n", $err)));
 }
 $smarty->assign("zone", $zonerec);
 $smarty->assign("pagetitle", "Editing master zone");
 $smarty->assign("rcount", sizeof($rec));
 $smarty->assign("record", $rec);
 $smarty->assign("types", $types);
 $smarty->assign("userlist", $users);
 $smarty->assign("template", "recordread.tpl");
 $smarty->assign("help", help("recordread"));
 $smarty->assign("menu_button", menu_buttons());
 $smarty->assign("page_root", $src . "record.php?i=" . $_GET['i'] . "&amp;");
Пример #3
0
}
$error .= $errors > '' ? $delm . $errors : '';
$deleted .= $deleteds > '' ? $delm . $deleteds : '';
$errors = '';
$comm = count($cmaster) > 0 ? "<strong>" . "Committing master records" . "</strong>\n\n" : '';
$mcomm = '';
foreach ($cmaster as $master) {
    $cmz = new masterZone(intval($master['id']));
    $cmz->loadZoneHead();
    $hd = $cmz->getZoneHead();
    $hdr = $cmz->getZoneHeadRaw();
    $cmz->writeZone($conf->path . $hdr['name'], $conf->hostMaster);
    $zarray = array('type' => 'master', 'file' => $hdr['name']);
    $zarray['file'] .= $hd['secured'] == 'yes' && $cmz->doSecure($conf->path, $conf->zoneSigner, $conf->rollInit, $conf->rollerConf) ? ".signed" : "";
    $cmz->doCommit();
    $err = $cmz->getErr();
    if ($err > '') {
        $errors .= "<u>" . $hd['name'] . ":</u> Error in committing\n" . $err . '\\n\\n';
    } else {
        $mcomm .= "<u>" . $hd['name'] . "</u>: Committing success.\n" . $cmz->getMsg() . "\n";
        $bind->addConfig($hdr['name'], $zarray);
        $done++;
    }
}
$error .= $errors > '' ? $comm . $errors : '';
$commited .= $mcomm > '' ? $comm . $mcomm : '';
$errors = '';
$comm = count($cslave) > 0 ? "<strong>" . "Committing slave records" . "</strong>\n\n" : '';
$commited .= $comm > '' ? "\n" : '';
$scomm = '';
foreach ($cslave as $slave) {