Example #1
0
}
if (empty($lst)) {
    myError($w, $p, my_("You first need to create some groups!"));
}
insert($f, textbrbr(my_("Admin Group")));
insert($f, span(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"), array("class" => "textSmall")));
insert($f, selectbox($lst, array("name" => "admingrp"), "{$ipplanGroup}"));
insert($f, textbrbr(my_("Network address")));
myFocus($p, "ENTRY", "ipaddr");
insert($f, input_text(array("name" => "ipaddr", "value" => isset($ipaddr) ? $ipaddr : "", "size" => "15", "maxlength" => "15")));
insert($f, textbrbr(my_("Number of contiguous networks to create")));
insert($f, input_text(array("name" => "num", "value" => "1", "size" => "3", "maxlength" => "3")));
insert($f, textbrbr(my_("Description")));
insert($f, span(my_("Leave blank to automatically describe"), array("class" => "textSmall")));
insert($f, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80")));
insert($f, textbrbr(my_("Subnet size/mask")));
// size maybe set from router script!!!
insert($f, selectbox(array("1" => "255.255.255.255/32 - host", "2" => "255.255.255.254/31 - 2 hosts", "4" => "255.255.255.252/30 - 4 hosts", "8" => "255.255.255.248/29 - 8 hosts", "16" => "255.255.255.240/28 - 16 hosts", "32" => "255.255.255.224/27 - 32 hosts", "64" => "255.255.255.192/26 - 64 hosts", "128" => "255.255.255.128/25 - 128 hosts", "256" => "255.255.255.0/24 - 256 hosts (class C)", "512" => "255.255.254.0/23 - 512 hosts", "1024" => "255.255.252.0/22 - 1k hosts", "2048" => "255.255.248.0/21 - 2k hosts", "4096" => "255.255.240.0/20 - 4k hosts", "8192" => "255.255.224.0/19 - 8k hosts", "16384" => "255.255.192.0/18 - 16k hosts", "32768" => "255.255.128.0/17 - 32k hosts", "65536" => "255.255.0.0/16 - 64k hosts (class B)", "131072" => "255.254.0.0/15 - 128k hosts", "262144" => "255.252.0.0/14 - 256k hosts"), array("name" => "size"), $size));
insert($f, textbr());
//if (NMAP != "" and ini_get("safe_mode") == 0) {
if (NMAP != "") {
    insert($f, checkbox(array("name" => "addnmapinfo", "value" => "1"), my_("Add active hosts using NMAP")));
    insert($f, text(" | "));
}
insert($f, checkbox(array("name" => "addhostinfo", "value" => "1"), my_("Add host names from DNS")));
insert($f, text(" | "));
insert($f, checkbox(array("name" => "dhcp", "value" => "1", "onclick" => "location.href='" . location_uri("createsubnetform.php?cust={$cust}&size={$size}&ipplanGroup={$ipplanGroup}&dhcp=1" . "'")), my_("Is this a DHCP subnet?"), $dhcp));
if ($dhcp) {
    insert($f, block("<p>"));
    insert($f, textb(my_("Creating a new DHCP subnet")));
}
Example #2
0
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")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Additional information")));
    //insert($f,textbr(my_("Additional information"), array("b"=>1)));
    if (isset($userfld)) {
        $template->Merge($userfld);
    }
    $template->DisplayTemplate($con);
}
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
Example #3
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);
Example #4
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);
Example #5
0
 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));
 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"))));
Example #6
0
insert($w, block("</small>"));
insert($w, block("</h3>"));
// start form
insert($w, $f = form(array("name" => "MODIFY", "method" => "post", "action" => "displaysubnet.php")));
myFocus($p, "MODIFY", "user");
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", "size" => "80", "maxlength" => "80")));
insert($con, block(" <a href='#' onclick='MODIFY.user.value=\"" . DHCPRESERVED . "\";'>" . my_("DHCP address") . "</a>"));
insert($con, textbrbr(my_("Location")));
insert($con, input_text(array("name" => "location", "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Device description")));
insert($con, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Telephone number")));
insert($con, input_text(array("name" => "telno", "size" => "15", "maxlength" => "15")));
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");
Example #7
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);
Example #8
0
$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")));
insert($f, textbrbr(my_("File name")));
insert($f, hidden(array("name" => "MAX_FILE_SIZE", "value" => MAXUPLOADSIZE)));
insert($f, inputfile(array("name" => "userfile")));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
$result->Close();
printhtml($p);
Example #9
0
    insert($f1, hidden(array("name" => "cust", "value" => "{$cust}")));
    insert($f1, hidden(array("name" => "ipaddr", "value" => "{$ipaddr}")));
    insert($f1, hidden(array("name" => "descrip", "value" => "{$descrip}")));
    insert($f1, hidden(array("name" => "size", "value" => "{$size}")));
    insert($f1, hidden(array("name" => "rangeindex", "value" => "{$rangeindex}")));
} else {
    // ugly kludge with global variable!
    $displayall = TRUE;
    $cust = myCustomerDropDown($ds, $f1, $cust, $grps) or myError($w, $p, my_("No customers"));
}
// show all areas, even ones with no ranges - need for create page
$areaindex = myAreaDropDown($ds, $f1, $cust, $areaindex, TRUE);
insert($w, $f2 = form(array("name" => "ENTRY", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
// save customer name for actual post of data
insert($f2, hidden(array("name" => "cust", "value" => "{$cust}")));
// save area index for actual post of data
insert($f2, hidden(array("name" => "areaindex", "value" => "{$areaindex}")));
if ($action == "modify") {
    insert($f2, hidden(array("name" => "rangeindex", "value" => "{$rangeindex}")));
    insert($f2, hidden(array("name" => "action", "value" => "modify")));
}
insert($f2, textbrbr(my_("Range address")));
insert($f2, input_text(array("name" => "ipaddr", "value" => "{$ipaddr}", "size" => "15", "maxlength" => "15")));
insert($f2, textbrbr(my_("Description")));
insert($f2, input_text(array("name" => "descrip", "value" => "{$descrip}", "size" => "80", "maxlength" => "80")));
insert($f2, textbrbr(my_("Range size/mask")));
insert($f2, selectbox(array("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", "524288" => "255.248.0.0/13", "1048576" => "255.240.0.0/12", "2097152" => "255.224.0.0/11", "4194304" => "255.192.0.0/10", "8388608" => "255.128.0.0/9", "16777216" => "255.0.0.0/8 (class A)"), array("name" => "size"), $size));
insert($f2, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
printhtml($p);
Example #10
0
     insert($f, radio(array("name" => "duplicatesubnet", "value" => "2"), my_("Duplicate subnet on new customer without IP detail")));
     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);
 }
Example #11
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";
$auth = new BasicAuthenticator(ADMINREALM, REALMERROR);
$auth->addUser(ADMINUSER, ADMINPASSWD);
// And now perform the authentication
$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_("Export subnet data");
newhtml($p);
$w = myheading($p, $title);
// display opening text
insert($w, heading(3, "{$title}."));
insert($w, textbrbr(my_("Export network data to flat ascii files.  The file will contain three columns each delimited by TAB. The first column contains the IP base address, the second the description and the third the mask in dotted decimal format.")));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f = form(array("method" => "post", "action" => "exportbase.php")));
$cust = myCustomerDropDown($ds, $f, 0, 0, FALSE) or myError($w, $p, my_("No customers"));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
printhtml($p);
Example #12
0
        $cust = $col;
        $custset = 1;
        // remember that customer was blank
    }
    // only make customer same as cookie if customer actually
    // still exists in database, else will cause loop!
    if ($custset) {
        if ($col == $ipplanCustomer) {
            // dont trust cookie
            $cust = floor($ipplanCustomer);
        }
    }
    $lst["{$col}"] = $row["custdescrip"];
}
insert($f, selectbox($lst, array("name" => "cust1[]", "multiple size" => 5), $cust));
insert($f, textbrbr(my_("Customer/autonomous system 2 - select multiple")));
$result = $ds->GetCustomerGrp(0);
$lst = array();
while ($row = $result->FetchRow()) {
    if (strtolower($row["custdescrip"]) == "all") {
        continue;
    }
    // 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 (!empty($grps)) {
        if (!$ds->TestGrpsAdmin($grps)) {
            if (!in_array($row["admingrp"], $grps)) {
                continue;
            }
        }
Example #13
0
            $ds->AuditLog(array("event" => 103, "action" => "export reverse zone", "cust" => $cust, "user" => getAuthUsername(), "id" => $value, "zone" => $ds->zone, "zoneip" => inet_ntoa($ds->zoneip), "size" => $ds->size, "tmpfname" => $tmpfname));
            $ds->DbfTransactionEnd();
            insert($w, textbr(sprintf(my_("Sent update to Backend Processor as file %s for domain %s zone ip %s zone size %s"), $tmpfname, $ds->zone, inet_ntoa($ds->zoneip), $ds->size)));
        } else {
            $ds->DbfTransactionRollback();
            $formerror .= my_("Zone could not be exported.  Try again.") . "\n";
        }
    }
}
// ##################### END OF Export Zone  ##############################
// Now Setup Page...
myError($w, $p, $formerror, FALSE);
insert($w, heading(3, "{$title}."));
insert($w, text(my_("Create and maintain reverse DNS zones. Reverse zone records are extracted from the host field of subnets created for this customer.")));
insert($w, block(my_(" Zones in bold and tagged with a &Dagger; have changed domain records, but have not been exported yet.")));
insert($w, textbrbr(my_("NOTE: Changed domain records are IP records that have been modified since the domain serial date. Thus even after an export the zone may still show changed as the resolution of the serial date is one day. The last modified date is the date when the SOA details for this zone have last changed.")));
insert($w, textbr());
// start form
insert($w, $f1 = form(array("name" => "THISFORM", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
// ugly kludge with global variable!
$displayall = FALSE;
$cust = myCustomerDropDown($ds, $f1, $cust, $grps) or myError($w, $p, my_("No customers"));
// get info from base table
// what is the additional search SQL?
$search = $ds->mySearchSql("zone", $expr, $descrip);
$sqllastmod = $ds->ds->SQLDate("M d Y H:i:s", 'lastmod');
$sqllastexp = $ds->ds->SQLDate("M d Y H:i:s", 'lastexp');
$result =& $ds->ds->Execute("SELECT id, zoneip, zonesize, zone, error_message, serialdate, \n                                serialnum, ttl, refresh, retry, expire, minimum, zonefilepath1, \n                                zonefilepath2, responsiblemail, customer, {$sqllastmod} AS lastmod, \n                                {$sqllastexp} AS lastexp, userid, slaveonly\n                             FROM zones \n                             WHERE customer={$cust} \n                             {$search}\n                             ORDER BY zone");
$arr = $_GET;
$arr["descrip"] = $descrip;
$arr["cust"] = $cust;
Example #14
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);
Example #15
0
// 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"))));
insert($f, freset(array("value" => my_("Clear"))));
printhtml($p);
Example #16
0
function insertCreateUserForm($w, $ds)
{
    list($userid, $userdescrip, $useremail, $grp) = myRegister("S:userid S:userdescrip S:useremail S:grp");
    insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
    insert($f, hidden(array("name" => "action", "value" => "parsecreateuserform")));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Create new user")));
    insert($con, textbr(my_("User-id (case sensitive!):")));
    insert($con, input_text(array("name" => "userid", "value" => "{$userid}", "size" => "20", "maxlength" => "40")));
    insert($con, textbrbr(my_("User's fullname:")));
    insert($con, input_text(array("name" => "userdescrip", "value" => "{$userdescrip}", "size" => "40", "maxlength" => "80")));
    insert($con, textbrbr(my_("User's e-mail:")));
    insert($con, input_text(array("name" => "useremail", "value" => "{$useremail}", "size" => "40", "maxlength" => "64")));
    if (AUTH_INTERNAL) {
        insert($con, textbrbr(my_("Password (case sensitive!):")));
        insert($con, password(array("name" => "password1", "size" => "20", "maxlength" => "40")));
        insert($con, textbrbr(my_("Password (again):")));
        insert($con, password(array("name" => "password2", "size" => "20", "maxlength" => "40")));
    }
    $result2 = $ds->GetGrps();
    $lst = array("" => "No group");
    while ($row = $result2->FetchRow()) {
        $col = $row["grp"];
        $lst["{$col}"] = $row["grp"] . " - " . $row["grpdescrip"];
    }
    insert($con, textbrbr(my_("Group")));
    insert($con, selectbox($lst, array("name" => "grp"), $grp));
    insert($f, generic("br"));
    insert($f, submit(array("value" => my_("Create User"))));
    insert($f, freset(array("value" => my_("Clear"))));
}
Example #17
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);
Example #18
0
        } 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.")));
}
// start form
insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
if ($action == "modify") {
    insert($f, hidden(array("name" => "cust", "value" => "{$cust}")));
    insert($f, hidden(array("name" => "action", "value" => "modify")));
    insert($f, hidden(array("name" => "areaindex", "value" => $areaindex)));
} else {
    // ugly kludge with global variable!
    $displayall = TRUE;
    $cust = myCustomerDropDown($ds, $f, $cust, $grps, FALSE) or myError($w, $p, my_("No customers"));
}
insert($f, textbrbr(my_("Area address")));
insert($f, input_text(array("name" => "ipaddr", "value" => "{$ipaddr}", "size" => "15", "maxlength" => "15")));
insert($f, textbrbr(my_("Description")));
insert($f, input_text(array("name" => "descrip", "value" => "{$descrip}", "size" => "80", "maxlength" => "80")));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
printhtml($p);
Example #19
0
// 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_("Display subnet information obtained from a routing table");
newhtml($p);
$w = myheading($p, $title, true);
// explicitly cast variables as security measure against SQL injection
list($cust) = myRegister("I:cust");
// display opening text
insert($w, heading(3, "{$title}."));
insert($w, text(my_("Display subnet information obtained from a routing table will show the routing table information on the left of the screen and the corresponding entries in the database on the right. If there are entries on both sides of the table, the subnet exists in the routing table and the database. If there are only entries on the left, the subnet only exists in the routing table. The same is true for the right hand side. If you click on the left, you can add the subnet to the database. If you click on the right, you can view the existing database information.")));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f = form(array("method" => "post", "action" => "displayrouter.php")));
$cust = myCustomerDropDown($ds, $f, $cust, $grps, FALSE) or myError($w, $p, my_("No customers"));
insert($f, textbrbr(my_("IP address of device to query")));
insert($f, span(my_("The device must be SNMP capable"), array("class" => "textSmall")));
insert($f, input_text(array("name" => "ipaddr", "size" => "15", "maxlength" => "15")));
insert($f, textbrbr(my_("Community string")));
$community = SNMP_COMMUNITY == "" ? "public" : SNMP_COMMUNITY;
insert($f, password(array("name" => "community", "value" => $community, "size" => "20", "maxlength" => "20")));
insert($f, textbrbr(my_("Router type")));
insert($f, span(my_("Type 'Generic' will work for most routers"), array("class" => "textSmall")));
$lst = array("generic" => my_("Generic"), "riverstone" => "RiverStone", "juniper" => "Juniper");
insert($f, selectbox($lst, array("name" => "rtrtype")));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
printhtml($p);
Example #20
0
function myRangeDropDown($ds, $f2, $cust, $areaindex)
{
    $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"
    insert($f2, textbrbr(my_("Range (optional)")));
    $lst = array();
    $lst["0"] = my_("No range selected");
    while ($row = $result->FetchRow()) {
        $col = $row["rangeindex"];
        $lst["{$col}"] = inet_ntoa($row["rangeaddr"]) . "/" . inet_ntoa(inet_aton(ALLNETS) - $row["rangesize"] + 1) . "/" . inet_bits($row["rangesize"]) . " - " . $row["descrip"];
    }
    insert($f2, selectbox($lst, array("name" => "rangeindex")));
}
Example #21
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);
Example #22
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);
Example #23
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);
Example #24
0
insert($w, heading(3, "{$title}."));
insert($w, textbr(my_("Maintain forward zone domain records.")));
// start form
insert($w, $f1 = form(array("name" => "THISFORM", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
// ugly kludge with global variable!
$displayall = FALSE;
$cust = myCustomerDropDown($ds, $f1, $cust, $grps) or myError($w, $p, my_("No customers"));
//
// Get a List of Domains from the fwdzone table.
//
$result =& $ds->ds->Execute("SELECT domain, data_id FROM fwdzone \n                            WHERE customer={$cust} AND \n                            slaveonly=" . $ds->ds->qstr("N") . "\n                            ORDER BY domain");
if (!$result) {
    myError($w, $p, my_("No domains found. Create some domains and try again."));
}
insert($w, $f2 = form(array("name" => "DomainSelect", "method" => "post", "action" => "modifydnsrecord.php?cust=" . $cust)));
insert($f2, textbrbr(my_("Domain")));
insert($f2, span(my_("Master domains only"), array("class" => "textSmall")));
insert($f2, block("<SELECT NAME='domain' ONCHANGE='submit()'>" . "\n"));
$cnt = 0;
while ($row = $result->FetchRow()) {
    $data = $row["domain"];
    $cnt++;
    // set domain to first record if domain has not been selected prviously
    if ($cnt == 1 and empty($domain)) {
        $domain = $data;
    }
    // save data_id for later for the "Add" button
    if ($data == $domain) {
        $zoneid = $row["data_id"];
        insert($f2, block("<OPTION VALUE= '" . $data . "' SELECTED>" . $data . "\n"));
    } else {