Esempio n. 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);
Esempio n. 2
0
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"))));
myCopyPaste($f2, "ipplanCPfindfreeform", "ENTRY");
printhtml($p);
Esempio n. 3
0
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Search criteria")));
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")));
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")));
// get filenames with xsl extension from templates directory
$files = array();
if ($dir = @opendir("../templates")) {
    while ($filename = readdir($dir)) {
        if (preg_match("/\\.xsl\$/", $filename)) {
            $files["{$filename}"] = $filename;
        }
    }
    closedir($dir);
}
insert($con, textbrbr(my_("Template")));
insert($con, selectbox($files, array("name" => "filename")));
insert($con, textbrbr(my_("Network name (ntname field on registrar template)")));
insert($con, radio(array("name" => "ntnameopt", "value" => "0"), my_("Generate automatically"), "checked"));
insert($con, radio(array("name" => "ntnameopt", "value" => "1"), my_("Use subnet description")));
insert($con, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
myCopyPaste($f2, "ipplanCPswipform", "ENTRY");
printhtml($p);
Esempio n. 4
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);
Esempio n. 5
0
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")));
    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, "ipplanCPcreateform", "ENTRY");
$result->Close();
printhtml($p);
Esempio n. 6
0
$years = array("0" => my_("Any"));
$i = 1990;
while ($i < date('Y') + 15) {
    $years[$i++] = $i;
}
insert($con, selectbox($years, array("name" => "year")));
if (DBF_TYPE == "mysql" or DBF_TYPE == "maxsql" or DBF_TYPE == "postgres7") {
    insert($con, textbrbr(my_("Search criteria (only display records matching the regular expression)")));
} else {
    insert($con, textbrbr(my_("Search criteria (only display records containing)")));
}
insert($con, input_text(array("name" => "search", "size" => "80", "maxlength" => "80")));
insert($con, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
myCopyPaste($f2, "ipplanCPsearchallform", "ENTRY");
printhtml($p);
// displays range drop down box - requires a working form
function searchRangeDropDown($ds, $f2, $cust, $areaindex, $rangeindex = 0)
{
    $cust = floor($cust);
    // dont trust $cust as it could
    // come from form post
    $areaindex = floor($areaindex);
    // display range drop down list
    if ($areaindex) {
        $result = $ds->GetRangeInArea($cust, $areaindex);
    } else {
        $result = $ds->GetRange($cust, 0);
    }
    // don't bother if there are no records, will always display "No range"
Esempio n. 7
0
    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) {
        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);
    }
    // Changed - End [FE]
    insert($f, generic("br"));
    insert($f, submit(array("value" => my_("Submit"))));
    insert($f, freset(array("value" => my_("Clear"))));
    myCopyPaste($f, "ipplanCPmodsubnet", "ENTRY");
}
printhtml($p);
Esempio n. 8
0
    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);
Esempio n. 9
0
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);
Esempio n. 10
0
// -------------------- template section ends here ---------------------------
insert($con, hidden(array("name" => "baseindex", "value" => "{$baseindex}")));
insert($con, hidden(array("name" => "ip", "value" => "{$ip}")));
insert($con, hidden(array("name" => "subnetsize", "value" => "{$subnetsize}")));
insert($con, hidden(array("name" => "block", "value" => "{$block}")));
insert($con, hidden(array("name" => "search", "value" => "{$search}")));
insert($con, hidden(array("name" => "expr", "value" => "{$expr}")));
insert($con, hidden(array("name" => "md5str", "value" => "{$md5str}")));
insert($con, hidden(array("name" => "close", "value" => "{$close}")));
// from the requestip - this will be the index to delete from the request
// table
insert($con, hidden(array("name" => "request", "value" => "0")));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
myCopyPaste($f, "ipplanCPip", "MODIFY");
// --------------------------- start of upload section ----------------------------
insert($w, $f = form(array("method" => "post", "enctype" => "multipart/form-data", "action" => $_SERVER["PHP_SELF"] . "?baseindex={$baseindex}&ip={$ip}&block={$block}")));
insert($f, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Upload files")));
//insert($f,block("<hr>"));
//insert($f,textbr(my_("Upload files"), array("b"=>1)));
//insert($f,block("<p>"));
// files have been uploaded previously - $files array has been initialize
// earlier
if (is_array($files)) {
    insert($con, $t = table(array("cols" => "5", "cellspacing" => "1", "class" => "outputtable")));
    // draw heading
    setdefault("cell", array("class" => "heading"));
    insert($t, $c = cell());