addGlobal(new Form_Input(
'tab',
null,
'hidden',
$tab
));
if ($tab == "port") {
$sectiontext = gettext('Port Alias Details');
$helptext = gettext('Paste in the ports to import separated by a carriage return. ' .
'The list may contain port numbers, port ranges, blank lines (ignored) and ' .
'an optional description after each port. e.g.:' .
'
- 22
- 1234:1250
- 443 HTTPS port
- 4000:4099 Description of a port range
' .
'
');
} else {
$sectiontext = gettext('IP Alias Details');
$helptext = gettext('Paste in the aliases to ' .
'import separated by a carriage return. Common examples are lists of IPs, ' .
'networks, blacklists, etc. The list may contain IP addresses, with or without ' .
'CIDR prefix, IP ranges, blank lines (ignored) and an optional description after ' .
'each IP. e.g.:- 172.16.1.2
- 172.16.0.0/24
- 10.11.12.100-' .
'10.11.12.200
- 192.168.1.254 Home router
- 10.20.0.0/16 Office ' .
'network
- 10.40.1.10-10.40.1.19 Managed switches
');
}
$section = new Form_Section($sectiontext);
$section->addInput(new Form_Input(
'name',
'*Alias Name',
'text',
$_POST['name']
))->setPattern('[a-zA-Z0-9_]+')->setHelp('The name of the alias may only consist '.
'of the characters "a-z, A-Z, 0-9 and _".');
$section->addInput(new Form_Input(
'descr',
'Description',
'text',
$_POST['descr']
))->setHelp('A description may be entered here for administrative reference (not parsed).');
$section->addInput(new Form_Textarea(
'aliasimport',
'*Aliases to import',
$_POST["aliasimport"]
))->setHelp($helptext);
$form->add($section);
print $form;
include("foot.inc");