예제 #1
0
// display opening text
insert($w, heading(3, "{$title}."));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f1 = form(array("name" => "THISFORM", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
$cust = myCustomerDropDown($ds, $f1, $cust, $grps) or myError($w, $p, my_("No customers"));
$areaindex = myAreaDropDown($ds, $f1, $cust, $areaindex);
insert($w, $f2 = form(array("name" => "ENTRY", "method" => "get", "action" => "modifybase.php")));
// save customer name for actual post of data
insert($f2, hidden(array("name" => "cust", "value" => "{$cust}")));
insert($f2, hidden(array("name" => "areaindex", "value" => "{$areaindex}")));
myRangeDropDown($ds, $f2, $cust, $areaindex);
insert($f2, block("<p>"));
insert($f2, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Search criteria")));
myFocus($p, "ENTRY", "ipaddr");
insert($con, textbr(my_("Subnet address (leave blank if range selected)")));
insert($con, span(my_("Partial subnet addresses can be used eg. 172.20"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "ipaddr", "size" => "15", "maxlength" => "15")));
if (DBF_TYPE == "mysql" or DBF_TYPE == "maxsql" or DBF_TYPE == "postgres7") {
    insert($con, textbrbr(my_("Description (only display networks matching the regular expression)")));
} else {
    insert($con, textbrbr(my_("Description (only display networks containing)")));
}
insert($con, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80")));
insert($con, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
myCopyPaste($f2, "ipplanCPmodbaseform", "ENTRY");
printhtml($p);
예제 #2
0
     $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);
 insert($t, $c = cell());
 insert($c, block("<small>"));
 insert($c, block($result->UserTimeStamp($row["lastmod"], "M d Y H:i:s")));
 insert($c, block("</small>"));
 $export->addCell($row["lastmod"]);
 insert($t, $c = cell());
 insert($c, text($row["userid"]));
 $export->addCell($row["userid"]);
 $export->saveRow();
 insert($t, $c = cell());
예제 #3
0
insert($con, hidden(array("name" => "baseindex", "value" => $baseindex)));
insert($con, hidden(array("name" => "block", "value" => $block)));
insert($con, hidden(array("name" => "search", "value" => $search)));
insert($con, hidden(array("name" => "expr", "value" => "{$expr}")));
$cnt = 0;
foreach ($ip as $value) {
    insert($con, hidden(array("name" => "ip[" . $cnt++ . "]", "value" => "{$value}")));
}
insert($con, hidden(array("name" => "md5str", "value" => "{$md5str}")));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
// start form for delete
// all info will be blank, thus record will be deleted
$settings = array("name" => "DELETE", "method" => "post", "action" => "displaysubnet.php");
if ($ipplanParanoid) {
    $settings["onsubmit"] = "return confirm('" . my_("Are you sure?") . "')";
}
insert($w, $f = form($settings));
insert($f, hidden(array("name" => "baseindex", "value" => "{$baseindex}")));
insert($f, hidden(array("name" => "block", "value" => "{$block}")));
insert($f, hidden(array("name" => "search", "value" => $search)));
insert($con, hidden(array("name" => "expr", "value" => "{$expr}")));
$cnt = 0;
foreach ($ip as $value) {
    insert($f, hidden(array("name" => "ip[" . $cnt++ . "]", "value" => "{$value}")));
}
insert($f, hidden(array("name" => "action", "value" => "delete")));
insert($f, hidden(array("name" => "md5str", "value" => "{$md5str}")));
insert($f, submit(array("value" => my_("Delete records"))));
insert($f, textbr(my_("WARNING: Deleting an entry does not preserve the last modified information as the record is completely removed from the database to conserve space.")));
printhtml($p);
예제 #4
0
    // end while: loop through ips of subnet.
    // Loop through the dynamic IPs above, and print the ranges.
    $iprange_start = $iprange_dynamicIPs[0];
    for ($i = 0; $i < count($iprange_dynamicIPs); $i++) {
        if ($iprange_dynamicIPs[$i] + 1 != $iprange_dynamicIPs[$i + 1]) {
            fputs($fp, sprintf("\t<iprange type=\"dynamic\" firstip=\"%s\" lastip=\"%s\" />\n", htmlspecialchars(inet_ntoa($iprange_start)), htmlspecialchars(inet_ntoa($iprange_dynamicIPs[$i]))));
            $iprange_start = $iprange_dynamicIPs[$i + 1];
        }
    }
    $iprange_start = $iprange_fixedIPs[0];
    for ($i = 0; $i < count($iprange_fixedIPs); $i++) {
        if ($iprange_fixedIPs[$i] + 1 != $iprange_fixedIPs[$i + 1]) {
            fputs($fp, sprintf("\t<iprange type=\"static\" firstip=\"%s\" lastip=\"%s\" />\n", htmlspecialchars(inet_ntoa($iprange_start)), htmlspecialchars(inet_ntoa($iprange_fixedIPs[$i]))));
            $iprange_start = $iprange_fixedIPs[$i + 1];
        }
    }
    fputs($fp, sprintf("</network>\n"));
}
// end while
if ($cnt) {
    fputs($fp, sprintf("</dhcp>\n"));
    fclose($fp);
    $ds->AuditLog(array("event" => 913, "action" => "export DHCP subnets", "cust" => $cust, "user" => getAuthUsername(), "tmpfname" => $tmpfname));
    insert($w, textbr(sprintf(my_("Sent update to Backend Processor as file %s"), $tmpfname)));
} else {
    myError($w, $p, my_("No DHCP subnets could be found."));
}
printhtml($p);
?>
 
예제 #5
0
    }
}
if ($areaindex == -1) {
    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));
예제 #6
0
list($cust, $areaindex) = myRegister("I:cust I:areaindex");
// start form
insert($w, $f1 = form(array("name" => "THISFORM", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
// ugly kludge with global variable!
$displayall = TRUE;
$cust = myCustomerDropDown($ds, $f1, $cust, $grps) or myError($w, $p, my_("No customers"));
$areaindex = myAreaDropDown($ds, $f1, $cust, $areaindex);
insert($w, $f2 = form(array("name" => "ENTRY", "method" => "get", "action" => "findfree.php")));
// save customer name for actual post of data
insert($f2, hidden(array("name" => "cust", "value" => "{$cust}")));
myRangeDropDown($ds, $f2, $cust, $areaindex);
insert($f2, block("<p>"));
insert($f2, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Search criteria")));
insert($con, textbr(my_("IP range start (leave blank if range selected)")));
insert($con, input_text(array("name" => "start", "size" => "15", "maxlength" => "15")));
insert($con, textbrbr(my_("IP range end (leave blank if range selected)")));
insert($con, input_text(array("name" => "end", "size" => "15", "maxlength" => "15")));
insert($con, textbrbr(my_("Display only subnets between these sizes")));
insert($con, span(my_("Minimum"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "size_from", "size" => "5", "maxlength" => "6")));
insert($con, span(my_("Maximum"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "size_to", "size" => "5", "maxlength" => "6")));
insert($con, textbrbr(my_("Show filter")));
insert($con, radio(array("name" => "showused", "value" => "0"), my_("Free and Unassigned")));
insert($con, radio(array("name" => "showused", "value" => "2"), my_("Unassigned only")));
insert($con, radio(array("name" => "showused", "value" => "1"), my_("All"), "checked"));
insert($con, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
예제 #7
0
$auth->authenticate();
// set language
isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']);
//setdefault("window",array("bgcolor"=>"white"));
//setdefault("table",array("cellpadding"=>"0"));
//setdefault("text",array("size"=>"2"));
$title = my_("Import subnet data");
newhtml($p);
$w = myheading($p, $title);
// display opening text
insert($w, heading(3, "{$title}."));
insert($w, text(my_("Import network data from flat ascii files.  The file should contain three columns each delimited by TAB. The first column contains the IP base address, the second the description and the third the mask either in dotted decimal format or in bit format.")));
insert($w, block("<p>"));
insert($w, text(my_("If the import file has more than three columns, each additional column will be added to the user defined fields defined in the basetemplate.xml file in the order specified in the template.")));
insert($w, block("<p>"));
insert($w, textbr(my_("If an error occurs during the import, the process will stop. Records that have been successfully imported should be deleted from the import file, the error corrected and the import resumed.")));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f = form(array("method" => "post", "enctype" => "multipart/form-data", "action" => "importbase.php")));
$cust = myCustomerDropDown($ds, $f, 0, 0, FALSE) or myError($w, $p, my_("No customers"));
$result = $ds->GetGrps();
$lst = array();
while ($row = $result->FetchRow()) {
    $col = $row["grp"];
    $lst["{$col}"] = $row["grpdescrip"];
}
if (empty($lst)) {
    myError($w, $p, my_("You first need to create some groups!"));
}
insert($f, textbrbr(my_("Admin Group")));
insert($f, selectbox($lst, array("name" => "admingrp")));
예제 #8
0
// 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);
}
if ($template->is_error() == FALSE) {
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
예제 #9
0
     insert($f, generic("br"));
 }
 insert($f, textbrbr(my_("Subnet description")));
 insert($f, input_text(array("name" => "descrip", "value" => "{$descrip}", "size" => "80", "maxlength" => "80")));
 insert($f, generic("br"));
 insert($f, checkbox(array("name" => "dhcp", "value" => "1"), my_("Is this a DHCP subnet?"), $dhcp));
 insert($f, generic("br"));
 insert($f, hidden(array("name" => "baseindex", "value" => "{$baseindex}")));
 insert($f, hidden(array("name" => "cust", "value" => "{$cust}")));
 insert($f, hidden(array("name" => "search", "value" => "{$search}")));
 insert($f, hidden(array("name" => "ipaddr", "value" => "{$ipaddr}")));
 insert($f, hidden(array("name" => "areaindex", "value" => "{$areaindex}")));
 insert($f, hidden(array("name" => "rangeindex", "value" => "{$rangeindex}")));
 insert($f, hidden(array("name" => "origcust", "value" => "{$origcust}")));
 insert($f, textbrbr(my_("Admin Group")));
 insert($f, textbr(my_("WARNING: If you choose a group that you do not have access to, you will not be able to see or access the data")));
 insert($f, selectbox($lst, array("name" => "grp"), $grp));
 // Changed - Begin [FE]
 // Requires new default template: basetemplate.xml
 // Start of template support [FE]
 $result =& $ds->ds->Execute("SELECT info, infobin\n            FROM baseadd\n            WHERE baseindex={$baseindex}");
 $rowadd = $result->FetchRow();
 $dbfinfo = $rowadd["info"];
 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);
 }
 if ($template->is_error() == FALSE) {
예제 #10
0
function UpdateLnk($ds, $w, $cust, $baseindex, $lnk, $ip)
{
    /*
    // got link address, see if there is a subnet for this link
    // if no subnet found, do nothing
    $result=$ds->GetBaseFromIndex($baseindex);
    $row = $result->FetchRow();
    $cust=$row["customer"];
    */
    $result = $ds->GetBaseFromIP(inet_aton($lnk), $cust);
    // yep found one, now see if a record exists
    if ($row = $result->FetchRow()) {
        $lnkidx = $row["baseindex"];
        if (!$ds->TestCustomerGrp($lnkidx, getAuthUsername())) {
            return sprintf(my_("Destination linked address %s IP record not created as you are not a member of the customers admin group"), $lnk) . "\n";
        }
        if (!($result = $ds->GetIPDetails($lnkidx, inet_aton($lnk)))) {
            // no row in subnet, then add one
            // NEED TO CHECK DESTINATION OWNERSHIP BEFORE ADDING RECORD
            $ds->ModifyIP(inet_aton($lnk), $lnkidx, "", "", "", "", "Linked address from " . inet_ntoa($ip), "", "");
            insert($w, textbr(sprintf(my_("Destination linked address %s IP record created"), $lnk)));
        }
    }
}
예제 #11
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(" &Dagger;"));
    } 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"]);
예제 #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
 $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)")));
 insert($con, textbr(my_("Nickname/handle:")));
 insert($con, input_text(array("name" => "nichandl", "value" => "{$nichandl}", "size" => "80", "maxlength" => "80")));
 insert($con, textbrbr(my_("Last name/surname:")));
 insert($con, input_text(array("name" => "lname", "value" => "{$lname}", "size" => "80", "maxlength" => "80")));
 insert($con, textbrbr(my_("First name:")));
 insert($con, input_text(array("name" => "fname", "value" => "{$fname}", "size" => "80", "maxlength" => "80")));
 insert($con, textbrbr(my_("Middle name:")));
 insert($con, input_text(array("name" => "mname", "value" => "{$mname}", "size" => "80", "maxlength" => "80")));
 insert($con, textbrbr(my_("Organization:")));
 insert($con, input_text(array("name" => "torg", "value" => "{$torg}", "size" => "100", "maxlength" => "100")));
 insert($con, textbrbr(my_("Street:")));
 insert($con, input_text(array("name" => "tstreet", "value" => "{$tstreet}", "size" => "80", "maxlength" => "255")));
 insert($con, textbrbr(my_("City:")));
 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));
예제 #14
0
            $cust = floor($ipplanCustomer);
        }
    }
    $lst["{$col}"] = $row["custdescrip"];
}
insert($w, $f = form(array("name" => "ENTRY", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
myFocus($p, "MODIFY", "request");
insert($f, textbrbr(my_("Customer")));
insert($f, selectbox($lst, array("name" => "cust"), $cust));
insert($f, textbrbr(my_("Request details")));
insert($f, span(my_("Enter full details describing the request to enable the administrators to allocate the correct IP address on the network"), array("class" => "textSmall")));
insert($f, input_text(array("name" => "request", "value" => $request, "size" => "80", "maxlength" => "80")));
insert($f, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("User information")));
insert($con, textbr(my_("User")));
insert($con, input_text(array("name" => "user", "value" => $user, "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Location")));
insert($con, input_text(array("name" => "location", "value" => $location, "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Device description")));
insert($con, input_text(array("name" => "descrip", "value" => $descrip, "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Device hostname")));
insert($con, input_text(array("name" => "hname", "value" => $hname, "size" => "80", "maxlength" => "100")));
insert($con, textbrbr(my_("Telephone number")));
insert($con, input_text(array("name" => "telno", "value" => $telno, "size" => "15", "maxlength" => "15")));
insert($con, textbrbr(my_("MAC address")));
insert($con, input_text(array("name" => "macaddr", "value" => $macaddr, "size" => "17", "maxlength" => "17")));
$template = new IPplanIPTemplate("iptemplate", $cust);
if ($template->is_error() == FALSE) {
    //insert($f,block("<hr>"));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
예제 #15
0
        // the fact that the range is unique prevents the range
        // being added to more than one area!
        if ($action == "modify") {
            $result =& $ds->ds->Execute("UPDATE netrange SET areaindex={$areaindex}, \n                    descrip=" . $ds->ds->qstr($descrip) . ",\n                    rangeaddr={$base}, rangesize={$size}\n                    WHERE rangeindex={$rangeindex}") and $ds->AuditLog(array("event" => 161, "action" => "modify range", "descrip" => $descrip, "user" => getAuthUsername(), "areaindex" => $areaindex, "baseaddr" => $ipaddr, "size" => $size, "cust" => $cust));
        } else {
            $result =& $ds->ds->Execute("INSERT INTO netrange\n                    (rangeaddr, rangesize, areaindex, descrip,\n                     customer)\n                    VALUES\n                    ({$base}, {$size}, {$areaindex},\n                     " . $ds->ds->qstr($descrip) . ",\n                     {$cust})") and $ds->AuditLog(array("event" => 160, "action" => "create range", "descrip" => $descrip, "user" => getAuthUsername(), "areaindex" => $areaindex, "baseaddr" => $ipaddr, "size" => $size, "cust" => $cust));
        }
        if ($result) {
            $ds->DbfTransactionEnd();
            if ($action == "modify") {
                Header("Location: " . location_uri("modifyarearange.php?cust={$cust}"));
                //insert($w,textbr(my_("Range modified")));
                //printhtml($p);
                exit;
            } else {
                insert($w, textbr(my_("Range created")));
            }
            $ipaddr = "";
            $descrip = "";
        } else {
            $ds->DbfTransactionRollback();
            $formerror .= my_("Range could not be created/modified - probably duplicate name") . "\n";
        }
    }
}
myError($w, $p, $formerror, FALSE);
// display opening text
insert($w, heading(3, "{$title}."));
if ($action == "modify") {
    insert($w, textbrbr(my_("Modify a range supernet/summary. Changing the range address or size to overlap with the currently defined range and size is not supported. Move the range out of the way first.")));
} else {
예제 #16
0
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);
예제 #17
0
    $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);
예제 #18
0
newhtml($p);
$w = myheading($p, $title);
// display opening text
insert($w, heading(3, "{$title}."));
insert($w, block("<br>" . my_("Import IP details data in XML format. The data is in the same format generated by <a HREF=\"http://www.insecure.org\">NMAP's</a> -oX parameter. This is useful to scan and obtain records for sites that have no previous information.")));
insert($w, block("<p>"));
insert($w, text(my_("Import IP details data from flat ascii files.  The file should contain a minimum of seven columns each delimited by TAB: ")));
insert($w, text(my_("The columns are imported in the following order: IP address, user, location, description, hostname, telephone number and mac address.")));
insert($w, block("<p>"));
insert($w, text(my_("If the import file has more than seven columns, each additional column will be added to the user defined fields defined in the iptemplate.xml file in the order specified in the template.")));
insert($w, block("<p>"));
insert($w, text(my_("If an error occurs during the import, the process will stop. Records that have been successfully imported should be deleted from the import file, the error corrected and the import resumed.")));
insert($w, block("<p>"));
insert($w, text(my_("NOTE: Any number of IP address records for various subnets can be in the file.  Any existing information will be overwritten.") . " "));
insert($w, text(my_("Imported addresses will only be added to existing subnets.") . " "));
insert($w, textbr(my_("If the merge flag is set, any fields that are empty or contain NULL will not be overwritten.")));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f = form(array("method" => "post", "enctype" => "multipart/form-data", "action" => "importip.php")));
$cust = myCustomerDropDown($ds, $f, 0, 0, FALSE) or myError($w, $p, my_("No customers"));
insert($f, textbrbr(my_("File name")));
insert($f, hidden(array("name" => "MAX_FILE_SIZE", "value" => MAXUPLOADSIZE)));
insert($f, inputfile(array("name" => "userfile")));
insert($f, textbrbr(my_("Format")));
insert($f, selectbox(array("text" => my_("Standard fields - text format"), "xml" => my_("Standard fields - NMAP XML format")), array("name" => "format")));
insert($f, generic("br"));
insert($f, generic("br"));
insert($f, checkbox(array("NAME" => "append"), " " . my_("Merge"), $c = ""));
insert($f, generic("br"));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
예제 #19
0
function parseAddGroupBoundaryForm($w, $ds)
{
    list($grp, $ipaddr, $size) = myRegister("S:grp S:ipaddr S:size");
    // explicitly cast variables as security measure against SQL injection
    $formerror = "";
    $size = floor($size);
    if ($_POST) {
        $base = inet_aton($ipaddr);
        // creating readonly group?
        if ($base == 0 and $size == 0) {
            if ($ds->ds->GetOne("SELECT count(*) AS cnt FROM bounds WHERE grp=" . $ds->ds->qstr($grp))) {
                $formerror .= my_("Boundary cannot be created - overlaps with existing boundary") . "\n";
            }
        } else {
            if (!$ipaddr) {
                $formerror .= my_("Boundary address may not be blank") . "\n";
            } else {
                if (testIP($ipaddr)) {
                    $formerror .= my_("Invalid boundary address") . "\n";
                } else {
                    if (!$size) {
                        $formerror .= my_("Size may not be zero") . "\n";
                    } else {
                        if (TestDuplicateBounds($ds, $base, $size, $grp)) {
                            $formerror .= my_("Boundary cannot be created - overlaps with existing boundary") . "\n";
                        }
                    }
                }
            }
            if ($size > 1) {
                if (TestBaseAddr(inet_aton3($ipaddr), $size)) {
                    $formerror .= my_("Invalid base address") . "\n";
                }
            }
        }
        if (!$formerror) {
            $ds->DbfTransactionStart();
            // the fact that the range is unique prevents the range
            // being added to more than one area!
            $result =& $ds->ds->Execute("INSERT INTO bounds\n                    (boundsaddr, boundssize, grp)\n                    VALUES\n                    ({$base}, {$size}, " . $ds->ds->qstr($grp) . ")");
            if ($result) {
                $ds->DbfTransactionEnd();
                insert($w, textbr(my_("Boundary created")));
                insertEditGroupForm($w, $ds);
            } else {
                $formerror .= my_("Boundary could not be created") . "\n";
            }
        }
    }
    return $formerror;
}
예제 #20
0
    // no real portable way to check if file was uploaded - php version
    // dependent
    if (!$fp) {
        myError($w, $p, my_("File could not be opened."));
    }
    // can we read the template?
    $template = FALSE;
    $template = new IPplanIPTemplate("iptemplate", $cust);
    if ($template->is_error() == TRUE) {
        myError($w, $p, my_("Template could not be opened."), FALSE);
        $template = FALSE;
        // use is_object later
    }
    while ($data = fgetcsv($fp, 4098, FIELDS_TERMINATED_BY)) {
        $rowcnt++;
        insert($w, textbr());
        insert($w, text(my_("Importing row:") . " {$rowcnt} "));
        ProcessRow($ds, $cust, $w, $p, $data, $template, $append);
    }
    fclose($fp);
}
$ds->DbfTransactionEnd();
printhtml($p);
// $data is number indexed array that has format of ip, user, location,
// description, telephone
function ProcessRow($ds, $cust, &$w, &$p, $data, $template, $append)
{
    global $format;
    $num = count($data);
    // blank row
    if (empty($data[0])) {
예제 #21
0
        }
        $ds->DbfTransactionStart();
        if ($action == "modify") {
            $result =& $ds->ds->Execute("UPDATE area SET areaaddr={$base}, \n                  descrip=" . $ds->ds->qstr($descrip) . " WHERE areaindex={$areaindex}") and $ds->AuditLog(array("event" => 151, "action" => "modify area", "descrip" => $descrip, "user" => getAuthUsername(), "area" => $ipaddr, "cust" => $cust));
        } else {
            $result =& $ds->ds->Execute("INSERT INTO area\n                  (areaaddr, descrip, customer)\n                  VALUES\n                  ({$base}, " . $ds->ds->qstr($descrip) . ", {$cust})") and $ds->AuditLog(array("event" => 150, "action" => "create area", "descrip" => $descrip, "user" => getAuthUsername(), "area" => $ipaddr, "cust" => $cust));
        }
        if ($result) {
            $ds->DbfTransactionEnd();
            if ($action == "modify") {
                Header("Location: " . location_uri("modifyarearange.php?cust={$cust}"));
                //insert($w,textbr(my_("Area modified")));
                //printhtml($p);
                exit;
            } else {
                insert($w, textbr(my_("Area created")));
            }
            $ipaddr = "";
            $descrip = "";
        } else {
            $ds->DbfTransactionRollback();
            $formerror .= my_("Area could not be created/modified - probably a duplicate name") . "\n";
        }
    }
}
myError($w, $p, $formerror, FALSE);
// display opening text
insert($w, heading(3, "{$title}."));
if ($action != "modify") {
    insert($w, textbrbr(my_("Create a new network area by entering a unique identifier address for the area. The identifier has the same format as IP addresses, but has no relation to existing IP address records. Areas usually define geographic or administrative boundaries. Areas can also contain multiple ranges of address space, as in many cases the address space is not contiguous - there may be a mix of private or public address space used.")));
}
예제 #22
0
 function Verify(&$layout)
 {
     $err = FALSE;
     foreach ($this->userfld as $field => $val) {
         // test against regex in template
         if (($this->userfld["{$field}"]["type"] == "C" or $this->userfld["{$field}"]["type"] == "T") and !empty($this->userfld["{$field}"]["regex"]) and !preg_match("/" . $this->userfld["{$field}"]["regex"] . "/", $this->userfld["{$field}"]["value"])) {
             insert($layout, text($this->userfld["{$field}"]["errmsg"], array("color" => "#FF0000")));
             insert($layout, textbr());
             $err = TRUE;
         }
     }
     return $err;
 }
예제 #23
0
function DisplayBlock($w, $row, $totcnt, $anchor, $fldindex = "")
{
    $cnt = intval($totcnt / MAXTABLESIZE);
    $vars = $_SERVER["PHP_SELF"] . "?block=" . $cnt . $anchor;
    if ($totcnt % MAXTABLESIZE == 0) {
        insert($w, anchor($vars, $fldindex ? $row[$fldindex] : inet_ntoa($row["baseaddr"])));
    }
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        insert($w, text(" - "));
        insert($w, anchor($vars, $fldindex ? $row[$fldindex] : inet_ntoa($row["baseaddr"])));
        insert($w, textbr());
    }
    return $vars;
}
예제 #24
0
// save customer name for actual post of data
insert($f2, hidden(array("name" => "cust", "value" => "{$cust}")));
insert($f2, hidden(array("name" => "areaindex", "value" => "{$areaindex}")));
myRangeDropDown($ds, $f2, $cust, $areaindex);
insert($f2, block("<p>"));
insert($f2, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Search criteria")));
myFocus($p, "ENTRY", "ipaddr");
insert($con, textbr(my_("Subnet network address (leave blank if range selected)")));
insert($con, span(my_("Partial subnet addresses can be used eg. 172.20"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "ipaddr", "size" => "15", "maxlength" => "15")));
insert($con, textbr());
insert($con, checkbox(array("name" => "searchin", "value" => "1", "onchange" => "document.ENTRY.jump.checked=document.ENTRY.searchin.checked;"), my_("Match any IP address in subnet")));
insert($con, checkbox(array("name" => "jump", "value" => "1"), my_("Jump to IP address record if found")));
insert($con, textbr());
insert($con, span(my_("Enter a complete ip address in above field and select the above options to go to the address record or subnet record"), array("class" => "textSmall")));
if (DBF_TYPE == "mysql" or DBF_TYPE == "maxsql" or DBF_TYPE == "postgres7") {
    insert($con, textbrbr(my_("Description (only display networks matching the regular expression)")));
} else {
    insert($con, textbrbr(my_("Description (only display networks containing)")));
}
insert($con, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Display subnets larger than")));
insert($con, selectbox(array("0" => my_("Display all subnets"), "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")));
insert($con, textbr());
insert($con, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
myCopyPaste($f2, "ipplanCPdisbaseform", "ENTRY");
printhtml($p);
예제 #25
0
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"));
insert($f, submit(array("value" => my_("Go!"))));
printhtml($p);
예제 #26
0
insert($t, $c = cell());
insert($c, text(my_("Secondary NS")));
insert($t, $c = cell());
insert($c, text(my_("SerialDate")));
insert($t, $c = cell());
insert($c, text(my_("TTL")));
insert($t, $c = cell());
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
예제 #27
0
    $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"))));
// start form
insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
insert($f, hidden(array("name" => "action", "value" => "deleterequest")));
insert($f, submit(array("value" => my_("Clear IP address request list"))));
// start form
예제 #28
0
            insert($w, text(my_("Password changed")));
        } else {
            $formerror .= my_("Password could not be changed") . "\n";
        }
    }
}
if (!$_POST || $formerror) {
    myError($w, $p, $formerror, FALSE);
    if ($user) {
        insert($w, heading(3, sprintf(my_("Change password for user %s"), $user)));
    } else {
        insert($w, heading(3, sprintf(my_("Change password for user %s"), getAuthUsername())));
    }
    // start form
    insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text($title));
    // display opening text
    if ($user) {
        insert($con, hidden(array("name" => "user", "value" => "{$user}")));
    }
    insert($con, textbr(my_("New password (case sensitive!):")));
    insert($con, password(array("name" => "password1", "value" => "{$password1}", "size" => "40", "maxlength" => "40")));
    insert($con, textbrbr(my_("New password (again):")));
    insert($con, password(array("name" => "password2", "value" => "{$password2}", "size" => "40", "maxlength" => "40")));
    insert($con, generic("br"));
    insert($con, submit(array("value" => my_("Submit"))));
    insert($con, freset(array("value" => my_("Clear"))));
}
printhtml($p);
예제 #29
0
        insert($c, text($files[$key]["descrip"]));
        insert($t, $c = cell());
        insert($c, text($files[$key]["size"]));
        insert($t, $c = cell());
        insert($c, text($files[$key]["date"]));
        insert($t, $c = cell());
        insert($c, block("<small>"));
        insert($c, anchor($_SERVER["PHP_SELF"] . "?baseindex={$baseindex}&ip={$ip}&block={$block}&action=filedelete&ind={$key}", my_("Delete file")));
        insert($c, block("</small>"));
        insert($c, block(" | "));
        insert($c, block("<small>"));
        insert($c, anchor($_SERVER["PHP_SELF"] . "?baseindex={$baseindex}&ip={$ip}&block={$block}&action=filedownload&ind={$key}", my_("Download file")));
        insert($c, block("</small>"));
    }
}
insert($con, textbr(my_("Filename description")));
insert($con, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("File name")));
insert($con, hidden(array("name" => "MAX_FILE_SIZE", "value" => MAXUPLOADSIZE)));
insert($con, inputfile(array("name" => "userfile")));
insert($con, hidden(array("name" => "action", "value" => "fileupload")));
insert($con, hidden(array("name" => "md5str", "value" => "{$md5str}")));
insert($con, submit(array("value" => my_("Upload file"))));
// --------------------------- end of upload section ----------------------------
// complete delete form - created earlier
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}")));