// can only be one row - does not matter if nothing is // found as array search will return false $row = $result->FetchRow(); if (!in_array($row["admingrp"], $grps)) { myError($w, $p, my_("You may not export DHCP subnets as you are not a member of the customers admin group")); } $startnum = inet_aton(DEFAULTROUTE); $endnum = inet_aton(ALLNETS); // if a specific network template exists, use that, else use generic template $template = new IPplanIPTemplate("basetemplate-dhcp", $cust); $err = $template->is_error(); // error with template here is fatal if ($err) { myError($w, $p, my_("Error reading template!")); } insert($w, textb(sprintf(my_("Exporting all subnets marked as DHCP and all IP addresses with a user marked as '%s'"), DHCPRESERVED))); insert($w, textbr()); insert($w, textbr()); $cnt = 0; // search only for subnets marked dhcp $ds->dhcp = 1; $result = $ds->GetBase($startnum, $endnum, '', $cust); // loop through each subnet looking for a template while ($row = $result->FetchRow()) { $baseaddr = inet_ntoa($row["baseaddr"]); $baseindex = $row["baseindex"]; $descrip = $row["descrip"]; $size = inet_ntoa(inet_aton(ALLNETS) + 1 - $row["subnetsize"]); $broadcast = inet_ntoa($row["baseaddr"] + $row["subnetsize"] - 1); $result_template =& $ds->ds->Execute("SELECT info, infobin\n FROM baseadd\n WHERE baseindex={$baseindex}"); // no template defined on subnet, skip subnet
insert($t, $c = cell()); insert($c, text(my_("Changed by"))); insert($t, $ck = cell()); insert($ck, text(my_("Action"))); // capture data for the export view functionality $export = new exportForm(); $export->addRow(array("domain", "primary_DNS", "secondary_DNS", "serial_date", "ttl", "refresh", "retry", "expire", "minimum_ttl", "last_modified", "last_exported", "changed_by")); $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($f, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80"))); insert($f, textbrbr(my_("Subnet size/mask"))); // size maybe set from router script!!! insert($f, selectbox(array("1" => "255.255.255.255/32 - host", "2" => "255.255.255.254/31 - 2 hosts", "4" => "255.255.255.252/30 - 4 hosts", "8" => "255.255.255.248/29 - 8 hosts", "16" => "255.255.255.240/28 - 16 hosts", "32" => "255.255.255.224/27 - 32 hosts", "64" => "255.255.255.192/26 - 64 hosts", "128" => "255.255.255.128/25 - 128 hosts", "256" => "255.255.255.0/24 - 256 hosts (class C)", "512" => "255.255.254.0/23 - 512 hosts", "1024" => "255.255.252.0/22 - 1k hosts", "2048" => "255.255.248.0/21 - 2k hosts", "4096" => "255.255.240.0/20 - 4k hosts", "8192" => "255.255.224.0/19 - 8k hosts", "16384" => "255.255.192.0/18 - 16k hosts", "32768" => "255.255.128.0/17 - 32k hosts", "65536" => "255.255.0.0/16 - 64k hosts (class B)", "131072" => "255.254.0.0/15 - 128k hosts", "262144" => "255.252.0.0/14 - 256k hosts"), array("name" => "size"), $size)); insert($f, textbr()); //if (NMAP != "" and ini_get("safe_mode") == 0) { if (NMAP != "") { insert($f, checkbox(array("name" => "addnmapinfo", "value" => "1"), my_("Add active hosts using NMAP"))); insert($f, text(" | ")); } insert($f, checkbox(array("name" => "addhostinfo", "value" => "1"), my_("Add host names from DNS"))); insert($f, text(" | ")); insert($f, checkbox(array("name" => "dhcp", "value" => "1", "onclick" => "location.href='" . location_uri("createsubnetform.php?cust={$cust}&size={$size}&ipplanGroup={$ipplanGroup}&dhcp=1" . "'")), my_("Is this a DHCP subnet?"), $dhcp)); if ($dhcp) { insert($f, block("<p>")); insert($f, textb(my_("Creating a new DHCP subnet"))); } insert($f, textbr()); // if called from findfree, save find results if (isset($_SERVER['HTTP_REFERER']) and stristr($_SERVER['HTTP_REFERER'], "findfree.php")) { insert($f, hidden(array("name" => "findfree", "value" => base64_encode($_SERVER['HTTP_REFERER'])))); } // Requires new default template: basetemplate.xml // Start of template support [FE] if ($dhcp) { // use dhcp template (for additional subnet information) $template = new IPplanIPTemplate("basetemplate-dhcp", $cust); } else { // use base template (for additional subnet information) $template = new IPplanIPTemplate("basetemplate", $cust); }
insert($w, heading(3, sprintf(my_("Search for IP subnets not part of a range for customer '%s'"), $ds->custdescrip))); } elseif ($areaindex and !$rangeindex) { insert($w, heading(3, sprintf(my_("Search for IP subnets between multiple ranges for customer '%s'"), $ds->custdescrip))); } else { insert($w, heading(3, sprintf(my_("Search for IP subnets between %s and %s %s for customer '%s'"), $ds->start, $ds->end, $ds->site, $ds->custdescrip))); } if ($ipaddr) { insert($w, textb(my_("IP address filter: "))); insert($w, textbr($ipaddr)); } if ($descrip) { insert($w, textb(my_("Description filter: "))); insert($w, textbr($descrip)); } if ($size > 0) { insert($w, textb(my_("Subnet size filter: Subnets larger than "))); insert($w, text(inet_ntoa(inet_aton(ALLNETS) + 1 - $size) . "/" . inet_bits($size))); } $srch = new mySearch($w, $_GET, $descrip, "descrip"); $srch->expr = $expr; $srch->expr_disp = TRUE; $srch->Search(); // draw the sucker! $totcnt = 0; $vars = ""; // fastforward till first record if not first block of data while ($block and $totcnt < $block * MAXTABLESIZE and $row = $result->FetchRow()) { $vars = DisplayBlock($w, $row, $totcnt, "&cust={$cust}&areaindex={$areaindex}" . "&rangeindex={$rangeindex}&ipaddr={$ipaddr}&expr={$expr}&size={$size}" . "&descrip=" . urlencode($descrip)); $totcnt++; } insert($w, block("<p>"));
} insert($view, block("<center><b>" . my_("Current Users/Groups") . "</b></center>")); insert($view, $cc = container("center")); insert($cc, block("| ")); insert($cc, anchor($_SERVER["PHP_SELF"] . "?action=newuserform", my_("New User"))); insert($cc, block(" | ")); insert($cc, anchor($_SERVER["PHP_SELF"] . "?action=newgroupform", my_("New Group"))); insert($cc, block(" |")); //insert($view, $cc = container("center")); insert($view, $searchform = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"]))); insert($searchform, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Search"))); insert($con, input_text(array("name" => "usersearch", "value" => "{$usersearch}", "size" => "20", "maxlength" => "40"))); insert($con, submit(array("value" => my_("Search")))); insert($view, textb(my_("Edit Users/Groups"))); insert($view, textbr()); insert($view, block("<i>" . my_("Click on a group or user") . "</i>")); $mid = new TreeMenu(); $mid->setDirroot('../menus'); $mid->setLibjsdir('../menus/libjs/'); $mid->setImgdir('../menus/menuimages/'); $mid->setImgwww('../menus/menuimages/'); $mid->setIcondir('../menus/menuicons/'); $mid->setIconwww('../menus/menuicons/'); $mid->SetMenuStructureString($MENU); $mid->setIconsize(16, 16); $mid->parseStructureForMenu('treemenu1'); $mid->newTreeMenu('treemenu1'); insert($view, block($mid->getTreeMenu('treemenu1'))); insert($view, block('<br><br>'));
insert($w, $r = container("fieldset", array("class" => "fieldset"))); insert($r, $q = container("div", array("class" => "textErrorBig"))); insert($q, textbr(my_("IF YOU ARE UPGRADING IPPLAN, BACKUP YOUR DATABASE NOW"))); insert($q, textbr(my_("THERE IS NO WAY TO RECOVER YOUR DATA IF SOMETHING GOES WRONG."))); insert($q, generic("p")); insert($q, textbr(my_("THE DISPLAY TEMPLATES HAVE MOVED TO A DIFFERENT DIRECTORY - READ THE CHANGELOG AND UPGRADE DOC"))); insert($w, $t = container("div", array("class" => "MrMagooInstall"))); insert($t, $s = container("ul")); insert($s, $l1 = container("li")); insert($l1, textb(my_("For security purposes, it is highly recomended that IPPlan is installed on an SSL Webserver."))); insert($s, generic("br")); insert($s, $l2 = container("li")); insert($l2, textb(my_("Production systems need to use a transaction-aware database table. Do not use MYISAM (use INNODB) and enable it in config.php"))); insert($s, generic("br")); insert($s, $l3 = container("li")); insert($l3, textb(my_("Read all Instructions carefully before proceeding!"))); insert($w, generic("br")); insert($w, block(my_("Have you read the <a href=\"http://iptrack.sourceforge.net/doku.php?id=faq\">FAQ</a>? How about the <a href=\"http://iptrack.sourceforge.net/documentation/\">User Manual</a>? "))); insert($w, text(my_("Have you read the UPGRADE document if upgrading?"))); insert($w, generic("br")); insert($w, generic("br")); insert($w, textbrbr(my_("What would you like to do today?"))); insert($w, $f = form(array("name" => "THISFORM", "method" => "POST", "action" => "schemacreate.php"))); insert($f, selectbox(array("0" => "Upgrade", "1" => "New Installation"), array("name" => "new"))); insert($f, generic("br")); insert($f, generic("br")); insert($f, textbr(my_("Would you like us to run the SQL against the database defined in config.php or would you rather print it to the screen so you can do it yourself?"))); insert($f, selectbox(array("0" => my_("Run the SQL Now"), "1" => my_("Just print it to the screen")), array("name" => my_("display")))); insert($f, generic("br")); insert($f, textbr(my_("If you are displaying the schema, please remove the comments with a text editor before executing into your database."))); insert($f, generic("br"));
$export->addRow(NULL); setdefault("cell", array("class" => color_flip_flop())); insert($t, $c = cell()); // no point in making this a hyperlink - there are no ranges so search will // always return nothing! insert($c, text(inet_ntoa($row["areaaddr"]))); $export->addCell(inet_ntoa($row["areaaddr"])); insert($t, $c = cell()); insert($c, text($row["adescrip"])); $export->addCell($row["adescrip"]); $export->addCell(my_("No range")); $export->addCell(""); $export->addCell(""); $export->addCell(my_("No range in this area")); $export->saveRow(); 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>")); $cnt++; } insert($w, block("<p>")); insert($w, textb(sprintf(my_("Total records: %u"), $cnt))); $temp2 = $cnt; $result->Close(); // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "total_ranges_and_areas_with_ranges", "total_areas_without_ranges"), array($cust, $ds->getCustomerDescrip($cust), $temp1, $temp2))); $export->createExportForm($w, NULL); printhtml($p);
$diff = (100 - $width) * 5; $width = $width * 5; insert($w, block("<img height=\"10\" width=\"{$width}\" src=\"../images/square_red.jpg\">")); insert($w, block("<img height=\"10\" width=\"{$diff}\" src=\"../images/square_green.jpg\">")); insert($w, textbr('')); insert($w, textb(my_("Total unassigned subnets (pre-allocated subnets marked as free): "))); insert($w, textbr($cntfree)); insert($w, textb(my_("Unassigned subnets (pre-allocated subnets marked as free): "))); insert($w, textbr(round($cntfreesubsize / ($endnum - $startnum + 1) * 100, 2) . "%")); $width = round($cntfreesubsize / ($endnum - $startnum + 1) * 100, 2); $diff = (100 - $width) * 5; $width = $width * 5; insert($w, block("<img height=\"10\" width=\"{$width}\" src=\"../images/square_red.jpg\">")); insert($w, block("<img height=\"10\" width=\"{$diff}\" src=\"../images/square_green.jpg\">")); insert($w, textbr()); insert($w, textb(my_("IP addresses allocated (including reserved addresses/excluding reserved addresses): "))); insert($w, textbr(round($used / ($endnum - $startnum + 1) * 100, 2) . "%" . "/" . round(($used - $cntsubnets * 2) / ($endnum - $startnum + 1) * 100, 2) . "%")); $width = round($used / ($endnum - $startnum + 1) * 100, 2); $diff = (100 - $width) * 5; $width = $width * 5; insert($w, block("<img height=\"10\" width=\"{$width}\" src=\"../images/square_red.jpg\">")); insert($w, block("<img height=\"10\" width=\"{$diff}\" src=\"../images/square_green.jpg\">")); } /* if( function_exists('memory_get_usage') ) { echo memory_get_usage(); // php >=4.3 only } */ // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "addr_start", "addr_end", "total_allocated_networks_subnets", "percent_network_subnets_allocated", "total_unassigned_subnets", "percent_unassigned_subnets", "percent_ip_allocated_include_reserved", "percent_ip_allocated_exclude_reserved"), array($cust, $ds->getCustomerDescrip($cust), $start, $end, $cnt, round($cntsubsize / ($endnum - $startnum + 1) * 100, 2), $cntfree, round($cntfreesubsize / ($endnum - $startnum + 1) * 100, 2), round($used / ($endnum - $startnum + 1) * 100, 2), round(($used - $cntsubnets * 2) / ($endnum - $startnum + 1) * 100, 2)))); $export->createExportForm($w, NULL);
} // $cblk will not exist if only a host - stats area not drawn if ($maxcnt > 1) { //if ($maxcnt > MAXTABLESIZE) { if ($printed or $totcnt / MAXTABLESIZE > 1) { insert($cblk, block(" |")); } insert($cblk, block("<p>")); // draw select box insert($consel, selectbox($lst, array("name" => "ip[]", "multiple size" => "5"))); } if ($block > 0) { $vars = $_SERVER["PHP_SELF"] . "?baseindex=" . $baseindex . "&block=" . ($block - 1) . "&showactive=" . $showactive . "&expr={$expr}&search=" . urlencode($search); insert($ck1, anchor($vars, "<<")); } insert($ck1, textb(my_("IP address"))); $result->Close(); // create the export view form $expression = $export->translateExpr($expr); $export->setInfo(array(array("customer_ID", "customer_description", "subnet_ID", "search_criterion", "search_expression", "total_addresses", "used_addresses", "free_addresses", "active_polled(D_W_M_Y)", "utilization", "efficiency"), array($cust, $ds->getCustomerDescrip($cust), $baseindex, $expression, $descrip, $maxcnt, $recs + 2 . "(including network and broadcast)", $maxcnt - $recs - 2, $pollcnt["d"] . "_" . $pollcnt["w"] . "_" . $pollcnt["m"] . "_" . $pollcnt["y"], round(($recs + 2) / $maxcnt * 100, 2), round($recs / $maxcnt * 100, 2)))); $export->createExportForm($w, NULL); printhtml($p); // myFetchRow class - special FetchRow to fill in missing records from subnet // required for pager to work as records are expected in sequence - this just completes // sequence class myFetchRow { var $result; var $baseaddr; var $subnetsize; var $pointer = -1;
$startnum = inet_aton($start); $endnum = inet_aton($end); $custdescrip = $ds->GetCustomerDescrip($cust); if ($areaindex and !$rangeindex) { insert($w, heading(3, sprintf(my_("Search for IP subnets between multiple ranges for customer '%s'"), $custdescrip))); $result = $ds->GetBaseFromArea($areaindex, $descrip, $cust); } else { insert($w, heading(3, sprintf(my_("Search for IP subnets between %s and %s %s for customer '%s'"), $start, $end, $site, $custdescrip))); $result = $ds->GetBase($startnum, $endnum, $descrip, $cust); } if ($ipaddr) { insert($w, textb(my_("IP address filter: "))); insert($w, textbr($ipaddr)); } if ($descrip) { insert($w, textb(my_("Description filter: "))); insert($w, textbr($descrip)); } insert($w, $f = form(array("name" => "swiptosend", "method" => "post", "action" => "emailswip.php"))); $cnt = 0; while ($row = $result->FetchRow()) { $temparray2 = array(); $swip = genSWIP($ds, $row["baseindex"], inet_ntoa($row["baseaddr"]), inet_ntoa($row["baseaddr"] + $row["subnetsize"] - 1), $cust, $row["descrip"], $row["swipmod"], $filename); if ($swip == FALSE) { myError($w, $p, my_("Error reading template!")); } insert($f, block("<pre>")); insert($f, text($swip)); insert($f, block("</pre>")); $ind = $row["baseindex"]; insert($f, checkbox(array("name" => "baseindex[]", "value" => "{$ind}"), my_("E-mail this entry?")));
// so do not create if (!$extst) { $warn = 1; myError($w, $p, sprintf(my_("Subnet %s not created - out of defined authority boundary"), inet_ntoa($base)) . "\n", FALSE); continue; } $restemp = $ds->GetDuplicateSubnet($base, $size, $cust); if ($restemp->FetchRow()) { $warn = 1; myError($w, $p, sprintf(my_("Subnet %s could not be created - possibly overlaps with an existing subnet"), inet_ntoa($base)) . "\n", FALSE); } else { // find subnets from other customers that overlap $result = $ds->GetDuplicateSubnetAll($base, $size, $grps); if ($row = $result->FetchRow()) { $warn = 1; insert($w, textb(my_("WARNING: "))); insert($w, text(sprintf(my_("Subnet %s overlaps with the following subnets from other customers. This may not be a problem as the subnet may occur in both customers routing tables:"), inet_ntoa($base)))); insert($w, block("<p>")); // create a table insert($w, $t = table(array("cols" => "3", "class" => "outputtable"))); // draw heading setdefault("cell", array("class" => "heading")); insert($t, $c = cell()); insert($c, text(my_("Base address"))); insert($t, $c = cell()); insert($c, text(my_("Subnet description"))); insert($t, $c = cell()); insert($c, text(my_("Customer"))); do { setdefault("cell", array("class" => color_flip_flop())); insert($t, $c = cell());
insert($c, text(my_("Last exported"))); insert($t, $c = cell()); insert($c, text(my_("Changed by"))); insert($t, $ck = cell()); insert($ck, text(my_("Action"))); //capture data for the export view functionality $export = new exportForm(); $export->addRow(array("zone", "primary_DNS", "secondary_DNS", "serial_date", "ttl", "refresh", "retry", "expire", "minimum_ttl", "last_modified", "last_exported", "changed_by")); $export->saveRow(); $cnt = 0; while ($row = $result->FetchRow()) { $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"])));
$srch = new mySearch($w, $arr, $descrip, "descrip"); $srch->legend = my_("Refine Search on Host"); $srch->expr = $expr; $srch->expr_disp = TRUE; $srch->Search(); // draw the sucker! } $totcnt = 0; $vars = ""; // fastforward till first record if not first block of data while ($block and $totcnt < $block * MAXTABLESIZE and $row = $result->FetchRow()) { $vars = DisplayBlock($w, $row, $totcnt, "&domain=" . urlencode($domain) . "&cust=" . $cust . "&expr={$expr}&descrip=" . urlencode($descrip), "sortorder"); $totcnt++; } insert($w, block("<p>")); insert($w, textb($domain)); insert($w, $f = form(array("name" => "deleterecords", "method" => "post", "action" => $_SERVER["PHP_SELF"]))); // create a table insert($f, $t = table(array("cols" => "7", "class" => "outputtable"))); // draw heading setdefault("cell", array("class" => "heading")); insert($t, $c = cell()); if (!empty($vars)) { insert($c, anchor($vars, "<<")); } insert($c, text(my_("Sort-Order"))); insert($t, $c = cell()); insert($c, text(my_("Host"))); insert($t, $c = cell()); insert($c, text(my_("Record Type"))); insert($t, $c = cell());
$sqllastmod = $ds->ds->SQLDate("M d Y H:i:s", 'ipaddr.lastmod'); if ($areaindex and !$rangeindex) { insert($w, heading(3, sprintf(my_("Search for IP subnets between multiple ranges for customer '%s'"), $custdescrip))); // NOTE: ipaddr column aliased to baseaddr to make DisplayBlock work $result =& $ds->ds->Execute("SELECT ipaddr.userinf, ipaddr.location, \n ipaddr.telno, ipaddr.descrip, {$sqllastmod} AS lastmod,\n ipaddr.ipaddr AS baseaddr, ipaddr.baseindex, \n ipaddr.hname, \n customer.custdescrip, customer.customer\n FROM ipaddr, base, netrange, customer {$addtables}\n {$where} AND\n base.customer = customer.customer AND\n base.baseindex = ipaddr.baseindex AND\n netrange.areaindex={$areaindex} AND\n base.baseaddr BETWEEN netrange.rangeaddr AND \n netrange.rangeaddr+netrange.rangesize-1 AND\n netrange.customer={$cust}"); // ORDER by // ipaddr.ipaddr"); } else { insert($w, heading(3, sprintf(my_("Search for IP subnets between %s and %s %s for customer '%s'"), $start, $end, $site, $custdescrip))); // NOTE: ipaddr column aliased to baseaddr to make DisplayBlock work // get detail from ipaddr table - could be nothing! $result =& $ds->ds->Execute("SELECT ipaddr.userinf, ipaddr.location, \n ipaddr.telno, ipaddr.descrip, {$sqllastmod} AS lastmod,\n ipaddr.ipaddr AS baseaddr, ipaddr.baseindex,\n ipaddr.hname, \n customer.custdescrip, customer.customer\n FROM ipaddr, base, customer {$addtables}\n {$where} AND\n base.customer = customer.customer AND\n base.baseindex = ipaddr.baseindex AND\n base.baseaddr BETWEEN {$startnum} AND {$endnum}"); // ORDER by // ipaddr.ipaddr"); } insert($w, textb(sprintf(my_("Search filter on %s: "), $field))); insert($w, textbr($search)); $totcnt = 0; $vars = ""; // fastforward till first record if not first block of data while ($block and $totcnt < $block * MAXTABLESIZE and $row = $result->FetchRow()) { $vars = DisplayBlock($w, $row, $totcnt, "&cust=" . $cust . "&areaindex=" . $areaindex . "&rangeindex=" . $rangeindex . "&day=" . $day . "&month=" . $month . "&year=" . $year . "&tmplfield=" . $tmplfield . "&search=" . urlencode($search) . "&field=" . $field); $totcnt++; } insert($w, block("<p>")); // create a table insert($w, $t = table(array("cols" => "6", "class" => "outputtable"))); // draw heading setdefault("cell", array("class" => "heading")); insert($t, $c = cell()); if (!empty($vars)) {
// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // require_once "../ipplanlib.php"; require_once "../config.php"; require_once "../layout/class.layout"; // set language isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']); //setdefault("window",array("bgcolor"=>"white")); $title = my_("DNS results"); newhtml($p); $w = myheading($p, $title, true); // explicitly cast variables as security measure against SQL injection list($ip) = myRegister("S:ip"); if (!$_GET) { myError($w, $p, my_("You cannot reload or bookmark this page!")); } if (testIP($ip)) { myError($w, $p, my_("Invalid IP address")); } $result = gethostbyaddr($ip); insert($w, text($result)); if ($result == $ip) { insert($w, textb(my_(" No DNS reverse record found"))); } printhtml($p);