<?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);
$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 : ''; $commited .= $mcomm > '' ? $comm . $mcomm : ''; $errors = '';