<?php require_once "include.php"; $param = intval($_GET['i']); if ($param > 0) { if ($user->isOwned($param, 'slave')) { $smarty->assign("pagetitle", "Dump slave zone"); $zone = new slaveZone(array('id' => $_GET['i'])); $zone->loadZoneHead(); $zonedef = ''; $head = $zone->getZoneHead(); $headraw = $zone->getZoneHeadRaw(); $name = $head['name']; $zonetype = "slave zone "; $ownerid = $head['owner']; $ouser = new User(array('id' => $ownerid)); $owner = $ouser->getFullName(); if (isset($_GET['pre']) && $_GET['pre'] == 'y') { $zonedef = $zone->dumpZone($conf->dig); $zonetype .= "(AXFR dump from it's master)"; } else { $zonetype .= "(locally mirrored)"; $lines = file($conf->path . $headraw['name']); $zonedef = ''; foreach ($lines as $line) { $zonedef .= $line; } } $smarty->assign("zonename", $name); $smarty->assign("zonetype", $zonetype); $smarty->assign("owner", $owner);
<?php require_once "include.php"; $zones = $user->getSlaves('live'); $count = sizeof($zones); $maxitems = intval($conf->range); $currpage = isset($_GET['page']) && intval($_GET['page']) > 0 ? $currpage = intval($_GET['page']) : 1; $fromto = makePart($count, $currpage); $buffer = array(); $i = isset($_GET['i']) ? intval($_GET['i']) : NULL; if (isset($i) && isset($_GET['check']) && ($_GET['check'] = 'y')) { if ($i > 0) { if ($user->isOwned($i, 'slave', 'live')) { $sz = new slaveZone($i); if ($sz->validateZone($conf->dig)) { $arr = $sz->getZoneHead($i); $arr['updated'] = 'yes'; $arr['valid'] = 'yes'; $sz->setZoneHead($arr); $sz->saveZoneHead(); } else { $smarty->assign("popuperror", $sz->getErr()); } } else { problem('notown'); } } else { problem(); } } for ($i = $fromto[0]; $i < $fromto[1]; $i++) {
foreach ($masters as $id) { $temp = new masterZone(intval($id)); $temp->loadZoneHead(); $head = $temp->getZoneHead(); $temp = array(); foreach (array('id', 'name', 'serial') as $key) { $temp[$key] = $head[$key]; } $masterlist[] = $temp; } $slaves = $xuser->getSlaves('live'); $slavelist = array(); foreach ($slaves as $id) { $temp = new slaveZone(intval($id)); $temp->loadZoneHead(); $head = $temp->getZoneHead(); $temp = array(); foreach (array('id', 'name', 'master') as $key) { $temp[$key] = $head[$key]; } $slavelist[] = $temp; $temp = array(); } $smarty->assign("zonelist", $masterlist); $smarty->assign("szonelist", $slavelist); $smarty->assign("template", "userread.tpl"); $smarty->assign("help", help("userread")); $smarty->assign("menu_button", menu_buttons()); $smarty->display("main.tpl"); } else { problem();
} 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) { $csz = new slaveZone(intval($slave['id'])); $csz->loadZoneHead(); $hd = $csz->getZoneHead(); $hdr = $csz->getZoneHeadRaw(); $err = $csz->getErr(); if ($err > '') { $errors .= "<u>" . $hd['name'] . ":</u> Error in committing\n" . $err . '\\n\\n'; } else { $csz->doCommit(); $scomm .= "<u>" . $hd['name'] . "</u>: Committing success.\n\n"; $bind->addConfig($hdr['name'], array('type' => 'slave', 'masters' => $hdr['master'], 'file' => $hdr['name'])); $done++; } } $error .= $errors > '' ? $comm . $errors : ''; $commited .= $scomm > '' ? $comm . $scomm : ''; $bind->saveConfig($conf->conf); if ($done > 0) {
<?php require_once "include.php"; $i = intval($_GET['i']); if ($i > 0) { if ($user->isOwned($i, 'slave', 'live')) { $sz = new slaveZone($i); $sz->loadZoneHead(); $zone = $sz->getZoneHead(); $smarty->assign("zone", $zone); $smarty->assign("pagetitle", "Editing slave zone"); $smarty->assign("userlist", $user->getAllusers()); $smarty->assign("template", "slave_recordread.tpl"); $smarty->assign("help", help("recordread")); $smarty->assign("menu_button", menu_buttons()); $smarty->assign("page_root", $src . "slave_record.php?i=" . $_GET['i'] . "&"); $smarty->display("main.tpl"); } else { problem('notown'); } } else { problem(); }
<?php require_once "include.php"; $zoneid = intval($_GET['i']); if ($zoneid > 0) { if ($user->isOwned($zoneid, 'slave')) { $smarty->assign("pagetitle", "Delete slave zone"); $zone = new slaveZone($zoneid); $zone->loadZoneHead(); $res = $zone->getZoneHead(); $smarty->assign("zone", $res['name']); $smarty->assign("zoneid", $zoneid); $smarty->assign("template", "slave_deletezone.tpl"); $smarty->assign("help", help("deletezone")); $smarty->assign("menu_button", menu_buttons()); $smarty->display("main.tpl"); } else { problem('notown'); } } else { problem(); }