insert($c, anchor($vars, "<<")); } insert($c, text(my_("Timestamp"))); insert($t, $ck = cell()); insert($ck, text(my_("Action"))); //capture data for the export view functionality $export = new exportForm(); $export->addRow(array("timestamp", "action")); $export->saveRow(); $cnt = 0; while ($row = $result->FetchRow()) { $export->addRow(NULL); setdefault("cell", array("class" => color_flip_flop())); insert($t, $c = cell()); insert($c, block($result->UserTimeStamp($row["newdt"], "M d Y H:i:s"))); $export->addCell($row["newdt"]); insert($t, $c = cell()); insert($c, text($row["action"])); $export->addCell($row["action"]); $export->saveRow(); if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) { break; } $cnt++; $totcnt++; } insert($w, block("<p>")); $vars = ""; $printed = 0; while ($row = $result->FetchRow()) { $totcnt++;
$export->saveRow(); $cnt = 0; while ($row = $result->FetchRow()) { setdefault("cell", array("class" => color_flip_flop())); $export->addRow(NULL); insert($t, $c = cell()); // have zone records been modified if ($row["error_message"] == "E") { insert($c, textb($row["domain"])); insert($c, block(" ‡")); } else { insert($c, text($row["domain"])); } if ($row["slaveonly"] == "Y") { insert($c, span(my_("Slave zone"), array("class" => "textSmall"))); $export->addCell($row["domain"] . my_(" (Slave zone)")); } else { $export->addCell($row["domain"]); } $result1 =& $ds->ds->Execute("SELECT hname FROM fwddns\n WHERE id=" . $row["data_id"] . "\n ORDER BY horder"); insert($t, $c = cell()); $row1 = $result1->FetchRow(); insert($c, text($row1["hname"])); $export->addCell($row1["hname"]); insert($t, $c = cell()); $row1 = $result1->FetchRow(); insert($c, text($row1["hname"])); $export->addCell($row1["hname"]); insert($t, $c = cell()); insert($c, text($row["serialdate"] . str_pad($row["serialnum"], 2, '0', STR_PAD_LEFT))); $export->addCell($row["serialdate"] . str_pad($row["serialnum"], 2, '0', STR_PAD_LEFT));
$i = 1; while ($row2 = $result2->FetchRow()) { $hname[$row2["horder"]] = $row2["hname"]; $i++; } // capture data for the export view functionality $export = new exportForm(); $export->addRow(array("name_server_1", "name_server_2", "name_server_3", "name_server_4", "name_server_5", "name_server_6", "name_server_7", "name_server_8", "name_server_9", "name_server_10")); $export->saveRow(); $export->addRow(NULL); // space for 10 reverse entries for ($i = 1; $i < 11; $i++) { insert($con, textbr(sprintf(my_("Name server %u:"), $i))); insert($con, input_text(array("name" => "hname[" . $i . "]", "value" => isset($hname[$i]) ? $hname[$i] : "", "size" => "80", "maxlength" => "100"))); insert($con, textbr()); $export->addCell(isset($hname[$i]) ? $hname[$i] : ""); } $export->saveRow(); insert($f, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Forward zone SOA header information"))); insert($con, textbr(my_("Technical contact email address"))); insert($con, span(my_("No @ allowed - replace with ."), array("class" => "textSmall"))); insert($con, input_text(array("name" => "responsiblemail", "value" => "{$responsiblemail}", "size" => "64", "maxlength" => "64"))); insert($con, textbrbr(my_("TTL"))); insert($con, input_text(array("name" => "ttl", "value" => "{$ttl}", "size" => "10", "maxlength" => "10"))); insert($con, textbrbr(my_("Refresh"))); insert($con, input_text(array("name" => "refresh", "value" => "{$refresh}", "size" => "5", "maxlength" => "10"))); insert($con, textbrbr(my_("Retry"))); insert($con, input_text(array("name" => "retry", "value" => "{$retry}", "size" => "5", "maxlength" => "10"))); insert($con, textbrbr(my_("Expire")));
$export->addRow(NULL); // customer is 0, display all customers with customer description // on customer change if ($cust == 0 and $row["custdescrip"] != $prevrow) { if (REGENABLED) { insert($t, $c = cell(array("colspan" => "7"))); } else { insert($t, $c = cell(array("colspan" => "6"))); } insert($c, generic("b")); insert($c, anchor($_SERVER["PHP_SELF"] . "?cust=" . $row["customer"] . "&areaindex=&rangeindex=&ipaddr={$ipaddr}&descrip=" . urlencode($descrip) . "&expr={$expr}&size={$size}", $row["custdescrip"])); $prevrow = $row["custdescrip"]; } insert($t, $c = cell()); insert($c, anchor("displaysubnet.php?baseindex=" . $row["baseindex"], inet_ntoa($row["baseaddr"]))); $export->addCell(inet_ntoa($row["baseaddr"])); if ($row["subnetsize"] == 1) { insert($t, $c = cell()); insert($c, text(my_("Host"))); $export->addCell(my_("Host")); } else { insert($t, $c = cell()); insert($c, text($row["subnetsize"])); $export->addCell($row["subnetsize"]); } insert($t, $c = cell()); insert($c, text(inet_ntoa(inet_aton(ALLNETS) + 1 - $row["subnetsize"]) . "/" . inet_bits($row["subnetsize"]))); $export->addCell(inet_ntoa(inet_aton(ALLNETS) + 1 - $row["subnetsize"]) . "/" . inet_bits($row["subnetsize"])); insert($t, $c = cell()); insert($c, text($row["descrip"])); $export->addCell($row["descrip"]);
if ($showused == 2) { $cnt++; continue; } } // handle beginning of range if ($rangeindex) { if ($i == 0 and $startnum != $arr[$i]["baseaddr"]) { // work out size from start of range $newsize = $arr[$i]["baseaddr"] - $startnum; //display only subnets with free space between from/to size if ($newsize >= $size_from && $newsize <= $size_to) { insert($t, $c = cell(array("class" => "greencell"))); insert($c, anchor("createsubnetform.php?ipaddr=" . $start . "&cust=" . $cust, $start)); $export->addRow(NULL); $export->addCell($start); insert($t, $c = cell()); insert($c, text($newsize)); $export->addCell($newsize); $export->addCell(""); insert($t, $c = cell()); insert($t, $c = cell()); insert($c, text(my_("Free space"))); $export->addCell(my_("free space")); $export->addCell(""); $export->saveRow(); insert($t, $c = cell()); insert($t, $c = cell()); $width = 100; insert($c, block("<img height=\"10\" width=\"{$width}\" src=\"../images/square_green.jpg\">")); }
insert($c, text(my_("User description"))); insert($t, $c = cell()); insert($c, text(my_("Request date"))); insert($t, $ck = cell()); insert($ck, text(my_("Action"))); //capture data for the export view functionality $export = new exportForm(); $export->addRow(array("customer_description", "request_description", "user", "user_description", "request_date")); $export->saveRow(); $cnt = 0; while ($row = $result->FetchRow()) { $export->addRow(NULL); setdefault("cell", array("class" => color_flip_flop())); insert($t, $c = cell()); insert($c, text($row["custdescrip"])); $export->addCell($row["custdescrip"]); insert($t, $c = cell()); insert($c, text($row["requestdesc"])); $export->addCell($row["requestdesc"]); insert($t, $c = cell()); insert($c, text($row["userinf"])); $export->addCell($row["userinf"]); insert($t, $c = cell()); insert($c, text($row["descrip"])); $export->addCell($row["descrip"]); insert($t, $c = cell()); insert($c, block($result->UserTimeStamp($row["lastmod"], "M d Y H:i:s"))); $export->addCell($row["lastmod"]); $export->saveRow(); insert($t, $c = cell()); insert($c, block("<small>"));
insert($t, $c = cell()); insert($c, text(my_("Action"))); $export = new exportForm(); $export->addRow(array("area_addr", "area_description", "range_addr", "range_size", "range_mask", "range_description")); $export->saveRow(); $cnt = 0; $savearea = 0; while ($row = $result->FetchRow()) { $export->addRow(Null); setdefault("cell", array("class" => color_flip_flop())); // first record could be NULL due to left join if ($savearea == $row["areaaddr"] and $cnt != 0) { insert($t, $c = cell()); insert($t, $c = cell()); insert($t, $c = cell()); $export->addCell(inet_ntoa($row["areaaddr"])); $export->addCell($row["adescrip"]); } else { if (is_numeric($row["areaaddr"])) { insert($t, $c = cell()); insert($c, anchor("displaybase.php?&cust=" . $cust . "&rangeindex=0" . "&areaindex=" . $row["areaindex"] . "&ipaddr=&descrip=&size=0", inet_ntoa($row["areaaddr"]))); $export->addCell(inet_ntoa($row["areaaddr"])); insert($t, $c = cell()); insert($c, text($row["adescrip"])); $export->addCell($row["adescrip"]); insert($t, $c = cell()); insert($c, block("<small>")); insert($c, anchor("deletearea.php?areaindex=" . $row["areaindex"] . "&cust=" . $cust, my_("Delete Area"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure?") . "')") : FALSE)); insert($c, block(" | ")); insert($c, anchor("createarea.php?action=modify&areaindex=" . $row["areaindex"] . "&ipaddr=" . inet_ntoa($row["areaaddr"]) . "&cust=" . $cust . "&descrip=" . urlencode($row["adescrip"]), my_("Modify Area"))); insert($c, block("</small>"));
// should be transaction here! $ds->UpdateIPPoll($baseindex, $row["ipaddr"]); $polled = 1; } else { insert($t, $c = cell(array("class" => "redcell"))); } } } else { insert($t, $c = cell()); } // strange! brackets must be there in php 4.0.4p1, else code wrong! $lnk = "modifyipform.php?ip=" . $row["ipaddr"] . "&baseindex=" . $baseindex . "&block=" . $block . "&expr={$expr}&search=" . urlencode($search); insert($c, anchor($lnk, $ip)); // insert($c,block(sprintf(' <A HREF="." ONCLICK="window.open(\'%s&close=1\', \'Name\', \'width=1000,height=600,toolbar=yes,scrollbars=yes\'); return false;">⇒</A>', $lnk))); insert($c, block(sprintf(' <A HREF="." ONCLICK="window.open(\'%s&close=1\', \'Name\', \'width=1000,height=600,toolbar=yes,scrollbars=yes\'); return false;">↺</A>', $lnk))); $export->addCell($ip); insert($t, $c = cell()); // network address if (SHOWRESERVED and $maxcnt > 2 and $row["ipaddr"] == $baseaddr) { insert($c, text(my_("Reserved - network address"), array("color" => "#FF0000"))); insert($c, textbr()); $export->addCell(my_("Reserved - network address")); } else { if (SHOWRESERVED and $maxcnt > 2 and $row["ipaddr"] == $baseaddr + $maxcnt - 1) { insert($c, text(my_("Reserved - broadcast address"), array("color" => "#FF0000"))); insert($c, textbr()); $export->addCell(my_("Reserved - broadcast address")); } else { // add to select drop down list $col = $row["ipaddr"]; $lst["{$col}"] = $ip;
while ($row = $result->FetchRow()) { setdefault("cell", array("class" => color_flip_flop())); $export->addRow(NULL); // strip out customers user may not see due to not being member // of customers admin group. $grps array could be empty if anonymous // access is allowed! if (!$adminuser) { if (!empty($grps)) { if (!in_array($row["admingrp"], $grps)) { continue; } } } insert($t, $c = cell()); insert($c, text($row["custdescrip"])); $export->addCell($row["custdescrip"]); insert($t, $c = cell()); insert($c, text($row["crm"])); $export->addCell($row["crm"]); insert($t, $c = cell()); insert($c, text($row["admingrp"])); $export->addCell($row["admingrp"]); $export->saveRow(); insert($t, $c = cell()); insert($c, block("<small>")); insert($c, anchor("deletecustomer.php?cust=" . $row["customer"], my_("Delete customer/AS"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure?") . "')") : FALSE)); insert($c, block(" | ")); insert($c, anchor("modifycustomer.php?cust=" . $row["customer"] . "&custdescrip=" . urlencode($row["custdescrip"]) . "&crm=" . urlencode($row["crm"]) . "&grp=" . urlencode($row["admingrp"]), my_("Modify customer/AS details"))); if (DHCPENABLED) { insert($c, block(" | ")); insert($c, anchor("exportdhcp.php?cust=" . $row["customer"], my_("Export DHCP details")));
$export->addRow(NULL); setdefault("cell", array("class" => color_flip_flop())); insert($t, $c = cell()); if ($row["error_message"] == "E" or $ds->RevZoneChanged($cust, $row["id"])) { insert($c, textb($row["zone"])); insert($c, block(" ‡")); } else { insert($c, text($row["zone"])); } // insert($c,text($row["zone"])); insert($c, textbr()); insert($c, block("<small><i>")); if ($row["slaveonly"] == "Y") { insert($c, text(my_("Slave zone"))); insert($c, textbr()); $export->addCell($row["zone"] . my_(" (Slave zone)") . " " . inet_ntoa($row['zoneip']) . "/" . inet_bits($row['zonesize'])); } else { $export->addCell($row["zone"] . " " . inet_ntoa($row['zoneip']) . "/" . inet_bits($row['zonesize'])); } insert($c, anchor("findfree.php?cust={$cust}&showused=1" . "&start=" . inet_ntoa($row["zoneip"]) . "&end=" . inet_ntoa($row["zoneip"] + $row["zonesize"] - 1), inet_ntoa($row["zoneip"]) . "/" . inet_bits($row["zonesize"]))); insert($c, block("</i></small>")); $result1 =& $ds->ds->Execute("SELECT hname FROM zonedns\n WHERE id=" . $row["id"] . "\n ORDER BY horder"); insert($t, $c = cell()); $row1 = $result1->FetchRow(); insert($c, text($row1["hname"])); $export->addCell($row1["hname"]); insert($t, $c = cell()); $row1 = $result1->FetchRow(); insert($c, text($row1["hname"])); $export->addCell($row1["hname"]); insert($t, $c = cell());
setdefault("cell", array("class" => color_flip_flop())); $export->addRow(NULL); $temphost = $row["host"]; $tempiphostname = $row["ip_hostname"]; /* if ($row["recordtype"]=="MX") { $tempiphostname=$temphost . " " . $tempiphostname; $temphost=""; } if ($row["recordtype"]=="@") { $temphost=""; } */ insert($t, $c = cell()); insert($c, text($row["sortorder"])); $export->addCell($row["sortorder"]); insert($t, $c = cell()); insert($c, text($temphost)); $export->addCell($temphost); insert($t, $c = cell()); insert($c, text($row["recordtype"])); $export->addCell($row["recordtype"]); // auto created record? if ($row["error_message"] == "A") { insert($c, block(" <small><i>")); insert($c, textbr(my_("Auto record"))); insert($c, block("</small></i>")); } insert($t, $c = cell()); insert($c, text($tempiphostname)); $export->addCell($tempiphostname);