if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) { break; } $cnt++; $totcnt++; } insert($w, block("<p>")); $vars = ""; $printed = 0; while ($row = $result->FetchRow()) { $totcnt++; $vars = DisplayBlock($w, $row, $totcnt, "&domain=" . urlencode($domain) . "&cust=" . $cust . "&expr={$expr}&descrip=" . urlencode($descrip), "domain"); if (!empty($vars) and !$printed) { insert($ck, anchor($vars, ">>")); $printed = 1; } } insert($w, block("<p>")); if ($cnt) { insert($w, anchor($_SERVER["PHP_SELF"] . "?cust={$cust}&dataid=0&action=export", my_("Export all changed DNS Zones"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure to Export?") . "')") : FALSE)); } else { myError($w, $p, my_("Search found no DNS Zone entries"), FALSE); } insert($w, $f = form(array("method" => "post", "action" => "modifydnsform.php?cust={$cust}&action=add"))); insert($f, submit(array("value" => my_("Add a DNS Zone")))); $result->Close(); // create the export view form $expression = $export->translateExpr($expr); $export->setInfo(array(array("customer_ID", "customer_description", "search_criterion", "search_expression"), array($cust, $ds->getCustomerDescrip($cust), $expression, $descrip))); $export->createExportForm($w, $template); printhtml($p);
insert($con, textbrbr(my_("Expire"))); insert($con, input_text(array("name" => "expire", "value" => "{$expire}", "size" => "5", "maxlength" => "10"))); insert($con, textbrbr(my_("Minimum TTL"))); insert($con, input_text(array("name" => "minimum", "value" => "{$minimum}", "size" => "5", "maxlength" => "10"))); $dbfinfo = $ds->ds->GetOne("SELECT info FROM fwdzoneadd \n WHERE customer={$cust} AND data_id={$dataid}"); // use base template (for additional subnet information) $template = new IPplanIPTemplate("fwdzonetemplate", $cust); if ($template->is_error() == FALSE) { insert($f, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Additional information"))); $template->Merge($template->decode($dbfinfo)); $template->DisplayTemplate($con); } insert($f, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Forward zone location"))); insert($con, textbr(my_("Zone File Path"))); insert($con, span(my_("The path where the zone file will be written once exported and processed. Examples:"), array("class" => "textSmall"))); insert($con, span(my_("ftp://myhost.com/var/named/test.zone - if you want to transfer the zone using ncftput"), array("class" => "textSmall"))); insert($con, span(my_("user@myhost.com:/var/named/test.zone - if you want to transfer the zone using scp"), array("class" => "textSmall"))); insert($con, input_text(array("name" => "zonepath", "value" => "{$zonepath}", "size" => "80", "maxlength" => "254"))); insert($con, textbrbr(my_("Secondary Zone File Path"))); insert($con, input_text(array("name" => "seczonepath", "value" => "{$seczonepath}", "size" => "80", "maxlength" => "254"))); insert($f, submit(array("value" => my_("Save")))); insert($f, freset(array("value" => my_("Clear")))); myCopyPaste($f, "ipplanCPdnsrecord", "ENTRY"); // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "data_ID", "domain", "email", "serialdate", "serialnum", "ttl", "retry", "refresh", "expire", "minimum_ttl", "slave_zone", "zone_path", "second_zone_path"), array($cust, $ds->getCustomerDescrip($cust), $dataid, $domain, $responsiblemail, $serialdate, $serialnum, $ttl, $retry, $refresh, $expire, $minimum, $slaveonly, $zonepath, $seczonepath))); $export->createExportForm($w, $template); printhtml($p);
} insert($w, block("<p>")); insert($w, text(my_("Total records:") . " " . $cnt)); /* include_once('../adodb/adodb-pager.inc.php'); $sql = "SELECT userid, action, dt FROM auditlog ORDER BY dt DESC"; function callback($buffer) { return ($buffer); } // need to print at this stage as display data is cached via layout template // buffer the output and do some tricks to place system call output in correct // place ob_start("callback"); $pager = new ADODB_Pager($ds->ds,$sql); //$pager->htmlSpecialChars = false; $pager->gridAttributes = "class=outputtable"; $pager->Render($rows_per_page=MAXTABLESIZE); $buf=ob_get_contents(); ob_end_clean(); insert($w,block($buf)); */ // create the export view form $expression = $export->translateExpr($expr); $export->setInfo(array(array("total_records", "search_criterion", "search_expression"), array($cnt, $expression, $descrip))); $export->createExportForm($w, NULL); printhtml($p);
$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); printhtml($p);
$cnt++; $totcnt++; } insert($w, block("<p>")); $vars = ""; $printed = 0; while ($row = $result->FetchRow()) { $totcnt++; $vars = DisplayBlock($w, $row, $totcnt, "&action=reqindex", "requestdesc"); if (!empty($vars) and !$printed) { insert($ck, anchor($vars, ">>")); $printed = 1; } } //create the export view form $export->setInfo(array(array("maintenance_page"), array("request index"))); $export->createExportForm($w, NULL); } // display opening text insert($w, heading(3, "{$title}.")); insert($w, textbr(my_("Perform the selected IPplan database maintenance."))); // start form insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"]))); insert($f, hidden(array("name" => "action", "value" => "custindex"))); insert($f, generic("p")); insert($f, submit(array("value" => my_("Display list of customer indexes")))); // start form insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"]))); insert($f, hidden(array("name" => "action", "value" => "reqindex"))); insert($f, generic("p")); insert($f, submit(array("value" => my_("View request list"))));
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; var $saverow; var $search; function myFetchRow(&$result, $baseaddr, $subnetsize, $search = FALSE) {
$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);
if (DHCPENABLED) { insert($c, block(" | ")); insert($c, anchor("exportdhcp.php?cust=" . $row["customer"], my_("Export DHCP details"))); } insert($c, block(" | ")); insert($c, anchor("../admin/usermanager.php?action=groupeditform&grp=" . urlencode($row["admingrp"]), my_("Group membership"))); insert($c, block("</small>")); if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) { break; } $cnt++; $totcnt++; } insert($w, block("<p>")); //insert($w,textb(sprintf(my_("Total records: %u"), $cnt))); $vars = ""; $printed = 0; while ($row = $result->FetchRow()) { $totcnt++; $vars = DisplayBlock($w, $row, $totcnt, "&expr={$expr}&search=" . urlencode($search), "custdescrip"); if (!empty($vars) and !$printed) { insert($ck, anchor($vars, ">>")); $printed = 1; } } $result->Close(); // create the export view form $expression = $export->translateExpr($expr); $export->setInfo(array(array("search_criterion", "search_expression"), array($expression, $search))); $export->createExportForm($w, $template); printhtml($p);
insert($con, hidden(array("name" => "cust", "value" => "{$cust}"))); myFocus($p, "ENTRY", "host"); insert($con, textbr(my_("Host Name"))); insert($con, block("<small><i>")); insert($con, textbr(my_("Terminate Fully Qualified Domand Name's (FQDN) with a . eg. mywwwserver.com. to signify 'This domain'"))); insert($con, block("</small></i>")); insert($con, input_text(array("name" => "host", "value" => "{$host}", "size" => "40", "maxlength" => "253"))); insert($con, anchor("JavaScript:thisdomain()", my_("This domain"))); // add some javascript magic to follow a link if field is completed insert($p, script(' function thisdomain() { document.ENTRY.host.value="' . $domain . '."; } ', array("language" => "JavaScript", "type" => "text/javascript"))); insert($con, textbrbr(my_("Record Type"))); insert($con, selectbox(array("A" => "A", "CNAME" => "CNAME", "MX" => "MX", "TXT" => "TXT", "KEY" => "KEY", "SRV" => "SRV", "NS" => "NS", "AFSDB" => "AFSDB"), array("name" => "recordtype"), $recordtype)); insert($con, textbrbr(my_("IP / Hostname"))); insert($con, block("<small><i>")); insert($con, textbr(my_("For MX records, format is \"preference hostname\", eg. \"10 mymailserver.com.\""))); insert($con, block("</small></i>")); insert($con, input_text(array("name" => "iphostname", "value" => "{$iphostname}", "size" => "40", "maxlength" => "250"))); insert($con, textbrbr(my_("Sort Order"))); insert($con, input_text(array("name" => "sortorder", "value" => "{$sortorder}", "size" => "6", "maxlength" => "6"))); insert($f, submit(array("value" => my_("Save")))); insert($f, freset(array("value" => my_("Clear")))); myCopyPaste($f, "ipplanCPdnsrecord", "ENTRY"); // create the export view form $export = new exportForm(); $export->setInfo(array(array("customer_ID", "customer_description", "data_ID", "domain", "sort_order", "host", "record_type", "ip_hostname"), array($cust, $ds->getCustomerDescrip($cust), $dataid, $domain, $sortorder, $host, $recordtype, $iphostname))); $export->createExportForm($w, NULL); printhtml($p);
insert($con, input_text(array("name" => "tcity", "value" => "{$tcity}", "size" => "80", "maxlength" => "80"))); insert($con, textbrbr(my_("State:"))); insert($con, selectbox($statecodes, array("name" => "tstate"), $tstate)); insert($con, textbrbr(my_("Zipcode:"))); insert($con, input_text(array("name" => "tzipcode", "value" => "{$tzipcode}", "size" => "10", "maxlength" => "10"))); insert($con, textbrbr(my_("Country:"))); insert($con, selectbox($countrycodes, array("name" => "tcntry"), $tcntry)); insert($con, textbrbr(my_("Telephone number:"))); insert($con, input_text(array("name" => "phne", "value" => "{$phne}", "size" => "20", "maxlength" => "20"))); insert($con, textbrbr(my_("E-mail address:"))); insert($con, input_text(array("name" => "mbox", "value" => "{$mbox}", "size" => "100", "maxlength" => "100"))); $result =& $ds->ds->Execute("SELECT info\n FROM custadd\n WHERE customer={$cust}"); $rowadd = $result->FetchRow(); $dbfinfo = $rowadd["info"]; // use base template (for additional subnet information) $template = new IPplanIPTemplate("custtemplate", $cust); if ($template->is_error() == FALSE) { insert($f, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Additional information"))); $template->Merge($template->decode($dbfinfo)); $template->DisplayTemplate($con); } insert($f, submit(array("value" => my_("Submit")))); insert($f, freset(array("value" => my_("Clear")))); myCopyPaste($f, "ipplanCPcustomer", "ENTRY"); // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "CRM", "group_name", "organization", "street", "city", "state", "zipcode", "country", "tech_contact_nickname", "tech_contact_last_name", "tech_contact_first_name", "tech_contact_middle_name", "tech_contact_org", "tech_contact_street", "tech_contact_city", "tech_contact_state", "tech_contact_zipcode", "tech_contact_country", "tech_contact_telephone", "tech_contact_email"), array($cust, $custdescrip, $crm, $grp, $org, $street, $city, $state, $zipcode, $cntry, $nichandl, $lname, $fname, $mname, $torg, $tstreet, $tcity, $tstate, $tzipcode, $tcntry, $phne, $mbox))); $export->createExportForm($w, $template); } printhtml($p);
insert($legend, text(my_("Reverse zone SOA header information"))); insert($con, text(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"))); insert($con, input_text(array("name" => "expire", "value" => "{$expire}", "size" => "5", "maxlength" => "10"))); insert($con, textbrbr(my_("Minimum TTL"))); insert($con, input_text(array("name" => "minimum", "value" => "{$minimum}", "size" => "5", "maxlength" => "10"))); insert($f, $con = container("fieldset", array("class" => "fieldset"))); insert($con, $legend = container("legend", array("class" => "legend"))); insert($legend, text(my_("Reverse zone location"))); insert($con, textbr(my_("Zone File Path"))); insert($con, span(my_("The path where the zone file will be written once exported and processed. Examples:"), array("class" => "textSmall"))); insert($con, span(my_("ftp://myhost.com/var/named/test.zone - if you want to transfer the zone using ncftput"), array("class" => "textSmall"))); insert($con, span(my_("user@myhost.com:/var/named/test.zone - if you want to transfer the zone using scp"), array("class" => "textSmall"))); insert($con, input_text(array("name" => "zonepath", "value" => "{$zonepath}", "size" => "80", "maxlength" => "254"))); insert($con, textbrbr(my_("Secondary Zone File Path"))); insert($con, input_text(array("name" => "seczonepath", "value" => "{$seczonepath}", "size" => "80", "maxlength" => "254"))); insert($f, submit(array("value" => my_("Save")))); insert($f, freset(array("value" => my_("Clear")))); myCopyPaste($f, "ipplanCPzone", "ENTRY"); // create the export view form $export->setInfo(array(array("customer_ID", "customer_description", "zoneid", "zone", "zone_ip", "email", "size", "serial_date", "serial_number", "ttl", "retry", "refresh", "expire", "minimum ttl", "slave_zone", "zone_path", "second_zone_path"), array($cust, $ds->getCustomerDescrip($cust), $zoneid, $zone, $zoneip, $responsiblemail, $size, $serialdate, $serialnum, $ttl, $retry, $refresh, $expire, $minimum, $slaveonly, $zonepath, $seczonepath))); $export->createExportForm($w, NULL); printhtml($p);
insert($fdel, hidden(array("name" => "baseindex", "value" => "{$baseindex}"))); insert($fdel, hidden(array("name" => "ip", "value" => "{$ip}"))); insert($fdel, hidden(array("name" => "subnetsize", "value" => "{$subnetsize}"))); insert($fdel, hidden(array("name" => "action", "value" => "delete"))); insert($fdel, hidden(array("name" => "block", "value" => "{$block}"))); insert($fdel, hidden(array("name" => "search", "value" => "{$search}"))); insert($fdel, hidden(array("name" => "expr", "value" => "{$expr}"))); insert($fdel, hidden(array("name" => "md5str", "value" => "{$md5str}"))); insert($fdel, hidden(array("name" => "close", "value" => "{$close}"))); insert($fdel, submit(array("value" => my_("Delete record")))); insert($fdel, text(my_("WARNING: Deleting an entry does not preserve the last modified information as the record is completely removed from the database to conserve space. "))); if (is_array($files)) { myError($fdel, $p, my_("Deleting this record will delete all associated uploaded files!") . "\n", FALSE); } // end of delete form // dummy form for "follow" function $settings = array("name" => "DUMMY", "method" => "get", "action" => "displaybase.php"); insert($w, $f = form($settings)); insert($f, hidden(array("name" => "ipaddr", "value" => $lnk))); insert($f, hidden(array("name" => "cust", "value" => $cust))); insert($f, hidden(array("name" => "searchin", "value" => "1"))); insert($f, hidden(array("name" => "jump", "value" => "1"))); // create the export view form $export = new exportForm(); $export->addRow(array("user", "location", "description", "hostname", "telephone", "mac_addr", "linked_addr")); $export->saveRow(); $export->addRow(array($userinf, $location, $descrip, $hname, $telno, $macaddr, $lnk)); $export->saveRow(); $export->setInfo(array(array("subnet_ID", "subnet_addr", "subnet_mask", "subnet_description", "ip_address"), array($baseindex, inet_ntoa($baseaddr), inet_ntoa(inet_aton(ALLNETS) + 1 - $subnetsize) . "/" . inet_bits($subnetsize), $netdescrip, $ip))); $export->createExportForm($w, $template); printhtml($p);