slave_zoneview.php
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?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);
$smarty->assign("zonedef", $zonedef);
$smarty->assign("template", "zoneview.tpl");
$smarty->assign("help", help("zoneview"));
$smarty->assign("menu_button", menu_buttons());
$smarty->display("main.tpl");
} else {
problem('notown');
}
} else {
problem();
}
?>