typesel_change(); proto_change(); <?php if (!empty($pconfig['srcbeginport']) && $pconfig['srcbeginport'] != "any" || !empty($pconfig['srcendport']) && $pconfig['srcendport'] != "any") { ?> show_source_port_range(); <?php } ?> var addressarray = <?php echo json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))); ?> ; var customarray = <?php echo json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))); ?> ; var oTextbox1 = new AutoSuggestControl(document.getElementById("src"), new StateSuggestions(addressarray)); var oTextbox2 = new AutoSuggestControl(document.getElementById("srcbeginport_cust"), new StateSuggestions(customarray)); var oTextbox3 = new AutoSuggestControl(document.getElementById("srcendport_cust"), new StateSuggestions(customarray)); var oTextbox4 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray)); var oTextbox5 = new AutoSuggestControl(document.getElementById("dstbeginport_cust"), new StateSuggestions(customarray)); var oTextbox6 = new AutoSuggestControl(document.getElementById("dstendport_cust"), new StateSuggestions(customarray)); //]]> </script> <?php include "fend.inc"; ?> </body>
$section->addInput(new Form_IpAddress('radns' . $idx, 'Server ' . $idx, $pconfig['radns' . $idx]))->setPattern('[a-zA-Z0-9_.:]+')->setHelp($idx < 3 ? '' : 'Leave blank to use the system default DNS servers - this interface\'s IP if DNS Forwarder or Resolver is enabled, otherwise the servers configured on the General page'); } $section->addInput(new Form_Input('radomainsearchlist', 'Domain search list', 'text', $pconfig['radomainsearchlist']))->setHelp('The RA server can optionally provide a domain search list. Use the semicolon character as separator.'); $section->addInput(new Form_Checkbox('rasamednsasdhcp6', 'Settings', 'Use same settings as DHCPv6 server', $pconfig['rasamednsasdhcp6'])); $section->addInput(new Form_Input('if', null, 'hidden', $if)); $form->add($section); print $form; ?> <script type="text/javascript"> //<![CDATA[ events.push(function() { // Suppress "Delete row" button if there are fewer than two rows checkLastRow(); // --------- Autocomplete ----------------------------------------------------------------------------------------- var addressarray = <?php echo json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))); ?> ; $('#radns1, #radns2, #radns3').autocomplete({ source: addressarray }); }); //]]> </script> <?php include "foot.inc";
} $section = new Form_Section('Edit route entry'); $section->addInput(new Form_IpAddress('network', 'Destination network', $pconfig['network']))->addMask('network_subnet', $pconfig['network_subnet'])->setPattern('[.a-zA-Z0-9_]+')->setHelp('Destination network for this static route'); $allGateways = array_combine(array_map(function ($g) { return $g['name']; }, $a_gateways), array_map(function ($g) { return $g['name'] . ' - ' . $g['gateway']; }, $a_gateways)); $section->addInput(new Form_Select('gateway', 'Gateway', $pconfig['gateway'], $allGateways))->setHelp('Choose which gateway this route applies to or <a href="' . '/system_gateways_edit.php">add a new one first</a>'); $section->addInput(new Form_Checkbox('disabled', 'Disabled', 'Disable this static route', $pconfig['disabled']))->setHelp('Set this option to disable this static route without removing it from ' . 'the list.'); $section->addInput(new Form_Input('descr', 'Description', 'text', htmlspecialchars($pconfig['descr'])))->setHelp('You may enter a description here for your reference (not parsed).'); $form->add($section); print $form; ?> <script> //<![CDATA[ events.push(function(){ // --------- Autocomplete ----------------------------------------------------------------------------------------- var addressarray = <?php echo json_encode(get_alias_list(array("host", "network"))); ?> ; $('#network').autocomplete({ source: addressarray }); }); //]]> </script> <?php include "foot.inc";
// We need to disable the elements so they are not submitted in the POST $('#address' + row).prop("disabled", hide); $('#address_subnet' + row).prop("disabled", hide || disable_subnets); $('#detail' + row).prop("disabled", hide); $('#deleterow' + row).prop("disabled", hide); } // On load . . typechange(); // Suppress "Delete row" button if there are fewer than two rows checkLastRow(); // Autocomplete var addressarray = <?php echo json_encode(array_exclude($pconfig['name'], get_alias_list($pconfig['type']))); ?> ; $('[id^=address]').autocomplete({ source: addressarray }); // on click . . $('#type').on('change', function() { typechange(); }); }); //]]> </script>
</td> </tr> </tbody> </table> </div> </td></tr></tbody> </table> </form> <script type="text/javascript"> //<![CDATA[ var addressarray = <?php echo json_encode(get_alias_list(array("host", "network"))); ?> ; var portsarray = <?php echo json_encode(get_alias_list("port")); ?> ; function createAutoSuggest() { <?php foreach ($suricata_servers as $key => $server) { echo " var objAlias{$key} = new AutoSuggestControl(document.getElementById('def_{$key}'), new StateSuggestions(addressarray));\n"; } foreach ($suricata_ports as $key => $server) { echo "var pobjAlias{$key} = new AutoSuggestControl(document.getElementById('def_{$key}'), new StateSuggestions(portsarray));\n"; } ?> } setTimeout("createAutoSuggest();", 500);