<?php require_once "include.php"; $znum = intval($_GET['i']) > 0 ? intval($_GET['i']) : NULL; if ($znum) { if ($user->isOwned($znum, 'master', 'live')) { $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);
<?php require_once "include.php"; $zones = $user->getMasters('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(); for ($i = $fromto[0]; $i < $fromto[1]; $i++) { $zone = new masterZone(array('id' => $zones[$i])); $zone->loadZoneHead(); $buffer[] = $zone->getZoneHead(); unset($zone); } $smarty->assign("zonelist", $buffer); $smarty->assign("pagetitle", "Master zones"); $smarty->assign("template", "zoneread.tpl"); $smarty->assign("help", help("zoneread")); $smarty->assign("menu_button", menu_buttons()); $smarty->assign("page_root", $src . "zonelist.php?"); $smarty->display("main.tpl");
* You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * ********************************************************************** * * Check what need to delete and provides info for confirmation * */ require_once "include.php"; $zoneid = intval($_GET['i']); if ($zoneid > 0) { if ($user->isOwned($zoneid, 'master')) { $smarty->assign("pagetitle", "Delete master zone"); $zone = new masterZone($zoneid); $zone->loadZoneHead(); $res = $zone->getZoneHead(); $smarty->assign("zone", $res['name']); $smarty->assign("zoneid", $zoneid); $smarty->assign("template", "deletezone.tpl"); $smarty->assign("help", help("deletezone")); $smarty->assign("menu_button", menu_buttons()); $smarty->display("main.tpl"); } else { problem('notown'); } } else { problem(); }
<?php require_once "include.php"; $param = isset($_GET['i']) ? intval($_GET['i']) : 0; if ($param > 0) { if ($user->isOwned($param, 'master')) { $smarty->assign("pagetitle", "Preview master zone"); $zone = new masterZone(array('id' => $_GET['i'])); $fname = tempnam($conf->Tmp_Path, "zone_"); $zone->writeZone($fname, $conf->HostMaster); $head = $zone->getZoneHead(); $name = $head['name']; $issec = $head['secured'] == "yes"; $sec = $_GET['s'] == "1" && $issec; $zonetype = "master zone"; $zonetype .= !$issec ? " not" : ""; $zonetype .= " secured, displayed as plain"; $ownerid = $head['owner']; $ouser = new User(array('id' => $ownerid)); $owner = $ouser->getFullName(); if (file_exists($fname)) { $lines = file($fname); $zonedef = implode("", $lines); unlink($fname); } else { $zonedef = NULL; $smarty->assign("popuperror", "There is a problem with this zone!"); } $smarty->assign("zonename", $name); $smarty->assign("zonetype", $zonetype); $smarty->assign("owner", $owner);
require_once "include.php"; if ($user->isAdmin()) { $i = isset($_GET['i']) ? intval($_GET['i']) : 0; if ($i > 1) { $smarty->assign("pagetitle", "Viewing user"); $smarty->assign("admin_array", array("yes", "no")); $xuser = new User($i); $data = $xuser->getUser(); $smarty->assign("user", $data); $xuser->loadUserZones(); $masters = $xuser->getMasters('live'); $masterlist = array(); 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];
$errors .= "<u>" . $hd['name'] . ":</u> Error in deleting\n" . $err . '\\n\\n'; } else { $deleteds .= "<u>" . $hd['name'] . "</u>: Deleting success.\n\n"; $bind->eraseConfig($hdr['name']); $done++; } } $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 : '';