示例#1
0
    $vars = DisplayBlock($w, $row, $totcnt, "&descrip=" . urlencode($descrip), "dt");
    $totcnt++;
}
// create a table
insert($w, $t = table(array("cols" => "2", "class" => "outputtable")));
// draw heading
setdefault("cell", array("class" => "heading"));
insert($t, $c = cell());
if (!empty($vars)) {
    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;
示例#2
0
insert($c, text(my_("Refresh")));
insert($t, $c = cell());
insert($c, text(my_("Retry")));
insert($t, $c = cell());
insert($c, text(my_("Expire")));
insert($t, $c = cell());
insert($c, text(my_("Min. TTL")));
insert($t, $c = cell());
insert($c, textbr(my_("Last modified")));
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("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(" &Dagger;"));
    } else {
        insert($c, text($row["domain"]));
    }
    if ($row["slaveonly"] == "Y") {
示例#3
0
insert($c, text(my_("Year")));
insert($c, selectbox($years, array("name" => "expireyear"), $expireyear));
insert($f, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
if ($action == "add") {
    insert($legend, text(my_("Zone SOA information if zone not created via zone transfer")));
} else {
    insert($legend, text(my_("Zone SOA information")));
}
$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")));
示例#4
0
insert($t, $c = cell());
insert($c, text(my_("Subnet size")));
insert($t, $c = cell());
insert($c, text(my_("Subnet mask")));
insert($t, $c = cell());
insert($c, text(my_("Description")));
insert($t, $c = cell());
insert($c, text(my_("Last modified")));
insert($t, $ck = cell());
insert($ck, text(my_("Changed by")));
if (REGENABLED) {
    insert($t, $ck = cell());
    insert($ck, text(my_("Update sent")));
}
//capture data for the export view functionality
$export = new exportForm();
$export->addRow(array("subnet_addr", "subnet_size", "subnet_mask", "description", "last_modified", "changed_by", "update_sent"));
$export->saveRow();
$cnt = 0;
$prevrow = "";
while ($row = $result->FetchRow()) {
    setdefault("cell", array("class" => color_flip_flop()));
    $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")));
        }
示例#5
0
// 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 size")));
insert($t, $c = cell());
insert($c, text(my_("Subnet mask")));
insert($t, $c = cell());
insert($c, text(my_("Description")));
insert($t, $c = cell());
insert($c, text(my_("Utilization")));
insert($t, $c = cell());
insert($c, text(my_("Barchart")));
//capture data for the export view functionality
$export = new exportForm();
$export->addRow(array("subnet_addr", "subnet_size", "subnet_mask", "description", "utilization"));
$export->saveRow();
for ($i = 0; $i < $maxcnt; $i++) {
    setdefault("cell", array("class" => color_flip_flop()));
    if (substr(strtolower($arr[$i]["descrip"]), 0, 4) == "free" or substr(strtolower($arr[$i]["descrip"]), 0, 5) == "spare") {
        $free = 1;
        $cntfree++;
    } else {
        $free = 0;
        // don't display anything if only unassigned is selected
        if ($showused == 2) {
            $cnt++;
            continue;
        }
    }
示例#6
0
 if (!empty($vars)) {
     insert($c, anchor($vars, "<<"));
 }
 insert($c, text(my_("Customer description")));
 insert($t, $c = cell());
 insert($c, text(my_("Request description")));
 insert($t, $c = cell());
 insert($c, text(my_("User")));
 insert($t, $c = cell());
 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"]);
示例#7
0
$ipscan = array();
if ($showactive and NMAP != "") {
    $nmapstart = inet_ntoa($baseaddr + $block * MAXTABLESIZE);
    if ($maxcnt > MAXTABLESIZE) {
        $nmapend = inet_ntoa($baseaddr + $block * MAXTABLESIZE + MAXTABLESIZE - 1);
    } else {
        $nmapend = inet_ntoa($baseaddr + $maxcnt - 1);
    }
    $ipscan = NmapScan(NmapRange($nmapstart, $nmapend));
    // nmap had error due to safe mode?
    if ($ipscan === FALSE) {
        $showactive = 0;
    }
}
//capture data for the export view functionality
$export = new exportForm();
$export->addRow(array("ip_addr", "user", "location", "description", "hostname", TELNO ? "telephone" : "mac_address", "last_polled", "last_modified", "changed_by"));
$export->saveRow();
$pollcnt = array("d" => 0, "w" => 0, "m" => 0, "y" => 0);
// note for translations to work here, the next field should have exactly 4x elements
$pollflag = split(":", my_("D:W:M:Y"));
$pollflag["d"] = $pollflag[0];
$pollflag["w"] = $pollflag[1];
$pollflag["m"] = $pollflag[2];
$pollflag["y"] = $pollflag[3];
$cnt = 0;
$lst = array();
while ($row = $rr->FetchRow()) {
    $export->addRow(NULL);
    setdefault("cell", array("class" => color_flip_flop()));
    // work out inet_ntoa once as it is slow!
示例#8
0
insert($c, text(my_("Area address")));
insert($t, $c = cell());
insert($c, text(my_("Description")));
insert($t, $c = cell());
insert($c, text(my_("Action")));
insert($t, $c = cell());
insert($c, text(my_("Range address")));
insert($t, $c = cell());
insert($c, text(my_("Range size")));
insert($t, $c = cell());
insert($c, text(my_("Range mask")));
insert($t, $c = cell());
insert($c, text(my_("Description")));
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 {
示例#9
0
 function createFile($info, $records, $ftype, $page)
 {
     if ($ftype == "csv") {
         $tempfile = exportForm::writeCSV($info, $records, $page);
     } elseif ($ftype == "plain") {
         $tempfile = exportForm::writePlain($info, $records, $page);
     } elseif ($ftype == "tab") {
         $tempfile = exportForm::writeTab($info, $records, $page);
     } elseif ($ftype == "xml") {
         $tempfile = exportForm::writeXML($info, $records, $page);
     }
     return $tempfile;
 }
示例#10
0
// 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 "../adodb/adodb.inc.php";
require_once "../class.dbflib.php";
require_once "../layout/class.layout";
require_once "../auth.php";
require_once "../class.templib.php";
require_once "../class.xptlib.php";
// script to create the file and serve it up as download
// $info = unserialize(urldecode($info));
// URL-passed null arguments get turned into "";
// convert $records back to null if it was previously
// this is so that isset() works later
// if ($nullrec == "TRUE") $records = NULL;
// else $records = unserialize(urldecode($records));
session_start();
if ($_SESSION['info'] != NULL) {
    $info = $_SESSION['info'];
} else {
    newhtml($p);
    insert($p, block("Session variable info is null. Something unexpected happened."));
    printhtml($p);
    exit;
}
$records = $_SESSION['records'];
session_destroy();
$tempfile = exportForm::createFile($info, $records, $ftype, $page);
exportForm::serveFile($tempfile, $page, $ftype);
示例#11
0
setdefault("cell", array("class" => "heading"));
insert($t, $c = cell());
if (!empty($vars)) {
    insert($c, anchor($vars, "<<"));
}
insert($c, text(my_("Customer description")));
insert($t, $c = cell());
insert($c, text(my_("CRM")));
insert($t, $c = cell());
insert($c, text(my_("Group name")));
insert($t, $ck = cell());
insert($ck, text(my_("Action")));
// do this here else will do extra queries for every customer
$adminuser = $ds->TestGrpsAdmin($grps);
//capture data for the export view functionality
$export = new exportForm();
$export->addRow(array("customer_description", "CRM", "group_name"));
$export->saveRow();
$cnt = 0;
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;
            }
        }
示例#12
0
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);
示例#13
0
 insert($con, input_text(array("name" => "org", "value" => "{$org}", "size" => "100", "maxlength" => "100")));
 insert($con, textbrbr(my_("Street:")));
 insert($con, input_text(array("name" => "street", "value" => "{$street}", "size" => "80", "maxlength" => "255")));
 insert($con, textbrbr(my_("City:")));
 insert($con, input_text(array("name" => "city", "value" => "{$city}", "size" => "80", "maxlength" => "80")));
 insert($con, textbrbr(my_("State:")));
 insert($con, selectbox($statecodes, array("name" => "state"), $state));
 insert($con, textbrbr(my_("Zipcode:")));
 insert($con, input_text(array("name" => "zipcode", "value" => "{$zipcode}", "size" => "10", "maxlength" => "10")));
 insert($con, textbrbr(my_("Country:")));
 insert($con, selectbox($countrycodes, array("name" => "cntry"), $cntry));
 insert($f, $con = container("fieldset", array("class" => "fieldset")));
 insert($con, $legend = container("legend", array("class" => "legend")));
 insert($legend, text(my_("Reverse DNS information (optional)")));
 //capture data for the export view functionality
 $export = new exportForm();
 $export->addRow(array("hostname_1", "ip_addr_1", "hostname_2", "ip_addr_2", "hostname_3", "ip_addr_3", "hostname_4", "ip_addr_4", "hostname_5", "ip_addr_5", "hostname_6", "ip_addr_6", "hostname_7", "ip_addr_7", "hostname_8", "ip_addr_8", "hostname_9", "ip_addr_9", "hostname_10", "ip_addr_10"));
 $export->saveRow();
 $export->addRow(NULL);
 // space for 10 reverse entries
 for ($i = 1; $i < 11; $i++) {
     insert($con, textbrbr(sprintf(my_("Hostname %u:"), $i)));
     insert($con, input_text(array("name" => "hname[" . $i . "]", "value" => isset($hname[$i]) ? $hname[$i] : "", "size" => "80", "maxlength" => "80")));
     $export->addCell(isset($hname[$i]) ? $hname[$i] : " ");
     insert($con, textbrbr(sprintf(my_("IP address %u:"), $i)));
     insert($con, input_text(array("name" => "ipaddr[" . $i . "]", "value" => isset($ipaddr[$i]) ? $ipaddr[$i] : "", "size" => "15", "maxlength" => "15")));
     $export->addCell(isset($ipaddr[$i]) ? $ipaddr[$i] : " ");
 }
 insert($f, $con = container("fieldset", array("class" => "fieldset")));
 insert($con, $legend = container("legend", array("class" => "legend")));
 insert($legend, text(my_("Technical contact information (optional)")));
示例#14
0
}
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());
insert($c, text(my_("IP/Hostname")));
insert($t, $c = cell());
insert($c, text(my_("Last modified")));
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("sort_order", "host", "record_type", "ip_hostname", "last_modified", "changed_by"));
$export->saveRow();
$cnt = 0;
while ($row = $result->FetchRow()) {
    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="";
示例#15
0
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);