Commit 2e20c8d6 authored by Franco Fichtner's avatar Franco Fichtner

firewall: simplify and prettify alias pages #443

parent afc4a48e
...@@ -140,22 +140,10 @@ ...@@ -140,22 +140,10 @@
</Interfaces> </Interfaces>
<Firewall order="3" cssClass="glyphicon glyphicon-fire"> <Firewall order="3" cssClass="glyphicon glyphicon-fire">
<Aliases order="10" cssClass="fa fa-list-alt fa-fw"> <Aliases order="10" cssClass="fa fa-list-alt fa-fw">
<All order="100" url="/firewall_aliases.php?tab=all"> <View order="100" url="/firewall_aliases.php">
<Edit url="/firewall_aliases_edit.php?tab=all" visibility="hidden"/> <Edit url="/firewall_aliases_edit.php*" visibility="hidden"/>
<Network url="/firewall_aliases.php?tab=network" visibility="hidden"/> </View>
<NoneEdit url="/firewall_aliases_edit.php?id=*" visibility="hidden"/> <Import order="200" url="/firewall_aliases_import.php"/>
<None url="/firewall_aliases.php" visibility="hidden"/>
</All>
<IPs order="200" url="/firewall_aliases.php?tab=ip">
<Edit url="/firewall_aliases_edit.php?tab=ip" visibility="hidden"/>
</IPs>
<Ports order="300" url="/firewall_aliases.php?tab=port">
<Edit url="/firewall_aliases_edit.php?tab=port" visibility="hidden"/>
</Ports>
<URLs order="400" url="/firewall_aliases.php?tab=url">
<Edit url="/firewall_aliases_edit.php?tab=url" visibility="hidden"/>
</URLs>
<Import order="500" url="/firewall_aliases_import.php"/>
</Aliases> </Aliases>
<Rules order="20" url="/firewall_rules.php" cssClass="fa fa-check fa-fw"> <Rules order="20" url="/firewall_rules.php" cssClass="fa fa-check fa-fw">
<RulesEdit url="/firewall_rules_edit.php*" visibility="hidden"/> <RulesEdit url="/firewall_rules_edit.php*" visibility="hidden"/>
......
...@@ -31,6 +31,25 @@ ...@@ -31,6 +31,25 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("filter.inc"); require_once("filter.inc");
function find_alias_type($type)
{
$types = array(
'host' => gettext('Host(s)'),
'network' => gettext('Network(s)'),
'port' => gettext('Port(s)'),
'url' => gettext('URL (IPs)'),
'url_ports' => gettext('URL (Ports)'),
'urltable' => gettext('URL Table (IPs)'),
'urltable_ports' => gettext('URL Table (Ports)'),
);
if (isset($types[$type])) {
return $types[$type];
}
return $type;
}
function find_alias_reference($section, $field, $origname, &$is_alias_referenced, &$referenced_by) { function find_alias_reference($section, $field, $origname, &$is_alias_referenced, &$referenced_by) {
global $config; global $config;
if(!$origname || $is_alias_referenced) if(!$origname || $is_alias_referenced)
...@@ -75,9 +94,6 @@ if (!isset($config['aliases']['alias'])) { ...@@ -75,9 +94,6 @@ if (!isset($config['aliases']['alias'])) {
} }
$a_aliases = &$config['aliases']['alias']; $a_aliases = &$config['aliases']['alias'];
// determine selected tab
$selected_tab = htmlspecialchars(($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/","",$_REQUEST['tab'])));
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['apply'])) { if (isset($_POST['apply'])) {
/* reload all components that use aliases */ /* reload all components that use aliases */
...@@ -128,7 +144,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -128,7 +144,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
filter_configure(); filter_configure();
mark_subsystem_dirty('aliases'); mark_subsystem_dirty('aliases');
} }
header("Location: firewall_aliases.php?tab=" . $selected_tab); header('Location: firewall_aliases.php');
exit; exit;
} }
} }
...@@ -137,7 +153,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -137,7 +153,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
legacy_html_escape_form_data($a_aliases); legacy_html_escape_form_data($a_aliases);
$main_buttons = array( $main_buttons = array(
array('href'=>'firewall_aliases_edit.php?tab='.$selected_tab, 'label'=>gettext("Add a new alias")), array('href' => 'firewall_aliases_edit.php', 'label' => gettext('Add a new alias')),
); );
include("head.inc"); include("head.inc");
...@@ -186,37 +202,18 @@ $( document ).ready(function() { ...@@ -186,37 +202,18 @@ $( document ).ready(function() {
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<td><?=gettext("Name"); ?></td> <td><?=gettext("Name"); ?></td>
<td><?=gettext("Values"); ?></td> <td><?=gettext("Type"); ?></td>
<td><?=gettext("Description"); ?></td> <td><?=gettext("Description"); ?></td>
<td><?=gettext("Values"); ?></td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
<?php <?php
uasort($a_aliases, function($a, $b){ uasort($a_aliases, function($a, $b) {
return strnatcmp($a['name'], $b['name']); return strnatcmp($a['name'], $b['name']);
}); });
foreach ($a_aliases as $i=> $alias){ foreach ($a_aliases as $i=> $alias){
$show_alias = false; ?>
switch ($selected_tab){
case "all":
$show_alias= true;
break;
case "ip":
case "host":
case "network":
if (preg_match("/(host|network)/",$alias["type"]))
$show_alias= true;
break;
case "url":
if (preg_match("/(url)/i",$alias["type"]))
$show_alias= true;
break;
case "port":
if($alias["type"] == "port")
$show_alias= true;
break;
}
if ($show_alias ){
?>
<tr> <tr>
<td ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> <td ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
<?=$alias['name'];?> <?=$alias['name'];?>
...@@ -238,10 +235,13 @@ $( document ).ready(function() { ...@@ -238,10 +235,13 @@ $( document ).ready(function() {
} }
?> ?>
<td ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> <td ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
<?=$alias_values; ?> <?= find_alias_type($alias['type']) ?>
</td>
<td ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
<?= $alias['descr'] ?>
</td> </td>
<td ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> <td ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
<?=$alias['descr'];?> <?= $alias_values ?>
</td> </td>
<td> <td>
<a href="firewall_aliases_edit.php?id=<?=$i;?>" title="<?=gettext("Edit alias"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a> <a href="firewall_aliases_edit.php?id=<?=$i;?>" title="<?=gettext("Edit alias"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
...@@ -249,17 +249,14 @@ $( document ).ready(function() { ...@@ -249,17 +249,14 @@ $( document ).ready(function() {
</td> </td>
</tr> </tr>
<?php <?php
} // if ($show_alias)
} // foreach } // foreach
?> ?>
<tr>
<td colspan="5">
<?=gettext("Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped."); ?>
</td>
</tr>
</table> </table>
<div class="container-fluid">
<span class="text-danger">
<strong><?=gettext("Note:"); ?><br />
</strong></span>
</span>
<?=gettext("Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped."); ?>
</div>
</form> </form>
</div> </div>
</section> </section>
......
...@@ -230,15 +230,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -230,15 +230,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
} }
if($pconfig['type'] == 'host') { header('Location: firewall_aliases.php');
header("Location: firewall_aliases.php?tab=ip");
} elseif (strpos($pconfig['type'],'url') !== false) {
header("Location: firewall_aliases.php?tab=url");
} else {
header("Location: firewall_aliases.php?tab=".$pconfig['type']);
}
exit; exit;
} }
} }
} }
...@@ -357,174 +350,168 @@ include("head.inc"); ...@@ -357,174 +350,168 @@ include("head.inc");
<div class="row"> <div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box tab-content">
<header class="content-box-head container-fluid"> <form action="firewall_aliases_edit.php" method="post" name="iform" id="iform">
<h3><?=gettext("Alias Edit");?></h3> <table class="table table-striped">
</header> <tr>
<div class="content-box-main"> <td width="22%"><strong><?=gettext("Alias Edit");?></strong></td>
<form action="firewall_aliases_edit.php" method="post" name="iform" id="iform"> <td width="78%" align="right">
<div class="table-responsive"> <small><?=gettext("full help"); ?> </small>
<table class="table table-striped"> <i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i>
<tr> </td>
<td colspan="2" align="right"> </tr>
<small><?=gettext("full help"); ?> </small> <tr>
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i> <td width="22%"><a id="help_for_name" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Name"); ?></td>
</td> <td width="78%">
</tr> <input name="origname" type="hidden" id="origname" class="form-control unknown" size="40" value="<?=$pconfig['name'];?>" />
<tr> <?php if (isset($id)): ?>
<td width="22%"><a id="help_for_name" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Name"); ?></td> <input name="id" type="hidden" value="<?=$id;?>" />
<td width="78%"> <?php endif; ?>
<input name="origname" type="hidden" id="origname" class="form-control unknown" size="40" value="<?=$pconfig['name'];?>" /> <input name="name" type="text" id="name" class="form-control unknown" size="40" maxlength="31" value="<?=$pconfig['name'];?>" />
<?php if (isset($id)): ?> <div class="hidden" for="help_for_name">
<input name="id" type="hidden" value="<?=$id;?>" /> <?=gettext("The name of the alias may only consist of the characters \"a-z, A-Z, 0-9 and _\"."); ?>
<?php endif; ?> </div>
<input name="name" type="text" id="name" class="form-control unknown" size="40" maxlength="31" value="<?=$pconfig['name'];?>" /> </td>
<div class="hidden" for="help_for_name"> </tr>
<?=gettext("The name of the alias may only consist of the characters \"a-z, A-Z, 0-9 and _\"."); ?> <tr>
</div> <td><a id="help_for_description" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description"); ?></td>
</td> <td>
</tr> <input name="descr" type="text" class="form-control unknown" id="descr" size="40" value="<?=$pconfig['descr'];?>" />
<tr> <div class="hidden" for="help_for_description">
<td><a id="help_for_description" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description"); ?></td> <?=gettext("You may enter a description here for your reference (not parsed)."); ?>
<td> </div>
<input name="descr" type="text" class="form-control unknown" id="descr" size="40" value="<?=$pconfig['descr'];?>" /> </td>
<div class="hidden" for="help_for_description"> </tr>
<?=gettext("You may enter a description here for your reference (not parsed)."); ?> <tr>
</div> <td><a id="help_for_type" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Type"); ?></td>
</td> <td>
</tr> <select name="type" class="form-control" id="typeSelect">
<tr> <option value="host" <?=$pconfig['type'] == "host" ? "selected=\"selected\"" : ""; ?>><?=gettext("Host(s)"); ?></option>
<td><a id="help_for_type" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Type"); ?></td> <option value="network" <?=$pconfig['type'] == "network" ? "selected=\"selected\"" : ""; ?>><?=gettext("Network(s)"); ?></option>
<td> <option value="port" <?=$pconfig['type'] == "port" ? "selected=\"selected\"" : ""; ?>><?=gettext("Port(s)"); ?></option>
<select name="type" class="form-control" id="typeSelect"> <option value="url" <?=$pconfig['type'] == "url" ? "selected=\"selected\"" : ""; ?>><?=gettext("URL (IPs)");?></option>
<option value="host" <?=$pconfig['type'] == "host" ? "selected=\"selected\"" : ""; ?>><?=gettext("Host(s)"); ?></option> <option value="url_ports" <?=$pconfig['type'] == "url_ports" ? "selected=\"selected\"" : ""; ?>><?=gettext("URL (Ports)");?></option>
<option value="network" <?=$pconfig['type'] == "network" ? "selected=\"selected\"" : ""; ?>><?=gettext("Network(s)"); ?></option> <option value="urltable" <?=$pconfig['type'] == "urltable" ? "selected=\"selected\"" : ""; ?>><?=gettext("URL Table (IPs)"); ?></option>
<option value="port" <?=$pconfig['type'] == "port" ? "selected=\"selected\"" : ""; ?>><?=gettext("Port(s)"); ?></option> <option value="urltable_ports" <?=$pconfig['type'] == "urltable_ports" ? "selected=\"selected\"" : ""; ?>><?=gettext("URL Table (Ports)"); ?></option>
<option value="url" <?=$pconfig['type'] == "url" ? "selected=\"selected\"" : ""; ?>><?=gettext("URL (IPs)");?></option> </select>
<option value="url_ports" <?=$pconfig['type'] == "url_ports" ? "selected=\"selected\"" : ""; ?>><?=gettext("URL (Ports)");?></option> <div class="hidden" for="help_for_type">
<option value="urltable" <?=$pconfig['type'] == "urltable" ? "selected=\"selected\"" : ""; ?>><?=gettext("URL Table (IPs)"); ?></option> <span class="text-info">
<option value="urltable_ports" <?=$pconfig['type'] == "urltable_ports" ? "selected=\"selected\"" : ""; ?>><?=gettext("URL Table (Ports)"); ?></option> <?=gettext("Networks")?><br/>
</select> </span>
<div class="hidden" for="help_for_type"> <small>
<span class="text-info"> <?=gettext("Networks are specified in CIDR format. Select the CIDR mask that pertains to each entry. /32 specifies a single IPv4 host, /128 specifies a single IPv6 host, /24 specifies 255.255.255.0, /64 specifies a normal IPv6 network, etc. Hostnames (FQDNs) may also be specified, using a /32 mask for IPv4 or /128 for IPv6.");?>
<?=gettext("Networks")?><br/> <br/>
</span> </small>
<small> <span class="text-info">
<?=gettext("Networks are specified in CIDR format. Select the CIDR mask that pertains to each entry. /32 specifies a single IPv4 host, /128 specifies a single IPv6 host, /24 specifies 255.255.255.0, /64 specifies a normal IPv6 network, etc. Hostnames (FQDNs) may also be specified, using a /32 mask for IPv4 or /128 for IPv6.");?> <?=gettext("Hosts")?><br/>
<br/> </span>
</small> <small>
<span class="text-info"> <?=gettext("Enter as many hosts as you would like. Hosts must be specified by their IP address or fully qualified domain name (FQDN). FQDN hostnames are periodically re-resolved and updated. If multiple IPs are returned by a DNS query, all are used.");?>
<?=gettext("Hosts")?><br/> <br/>
</span> </small>
<small> <span class="text-info">
<?=gettext("Enter as many hosts as you would like. Hosts must be specified by their IP address or fully qualified domain name (FQDN). FQDN hostnames are periodically re-resolved and updated. If multiple IPs are returned by a DNS query, all are used.");?> <?=gettext("Ports")?><br/>
<br/> </span>
</small> <small>
<span class="text-info"> <?=gettext("Enter as many ports as you wish. Port ranges can be expressed by separating with a colon.");?>
<?=gettext("Ports")?><br/> <br/>
</span> </small>
<small> <span class="text-info">
<?=gettext("Enter as many ports as you wish. Port ranges can be expressed by separating with a colon.");?> <?=gettext("URL's")?><br/>
<br/> </span>
</small> <small>
<span class="text-info"> <?=gettext("Enter a URL containing a large number of IPs,ports and/or Subnets. After saving the lists will be downloaded and scheduled for automatic updates when a frequency is provided.");?>
<?=gettext("URL's")?><br/> </small>
</span> </div>
<small> </td>
<?=gettext("Enter a URL containing a large number of IPs,ports and/or Subnets. After saving the lists will be downloaded and scheduled for automatic updates when a frequency is provided.");?> </tr>
</small> <tr>
</div> <td><div id="addressnetworkport"><a id="help_for_hosts" href="#" class="showhelp"><i class="fa fa-info-circle text-muted"></i></a> <?=gettext("Host(s)"); ?></div></td>
</td> <td>
</tr> <table class="table table-striped table-condensed" id="detailTable">
<tr> <thead>
<td><div id="addressnetworkport"><a id="help_for_hosts" href="#" class="showhelp"><i class="fa fa-info-circle text-muted"></i></a> <?=gettext("Host(s)"); ?></div></td> <tr>
<td> <th></th>
<table class="table table-striped table-condensed" id="detailTable"> <th id="detailsHeading1"><?=gettext("Network"); ?></th>
<thead> <th id="detailsHeading3"><?=gettext("Description"); ?></th>
<tr> <th id="updatefreqHeader" ><?=gettext("Update Freq. (days)");?></th>
<th></th> </tr>
<th id="detailsHeading1"><?=gettext("Network"); ?></th> </thead>
<th id="detailsHeading3"><?=gettext("Description"); ?></th> <tbody>
<th id="updatefreqHeader" ><?=gettext("Update Freq. (days)");?></th>
</tr>
</thead>
<tbody>
<?php if (is_array($pconfig['aliasurl'])): <?php if (is_array($pconfig['aliasurl'])):
$detail_desc = explode("||", $pconfig['detail']); $detail_desc = explode("||", $pconfig['detail']);
foreach ($pconfig['aliasurl'] as $aliasid => $aliasurl): foreach ($pconfig['aliasurl'] as $aliasid => $aliasurl):
?> ?>
<tr> <tr>
<td> <td>
<div style="cursor:pointer;" class="act-removerow btn btn-default btn-xs" alt="remove"><span class="glyphicon glyphicon-minus"></span></div> <div style="cursor:pointer;" class="act-removerow btn btn-default btn-xs" alt="remove"><span class="glyphicon glyphicon-minus"></span></div>
</td> </td>
<td> <td>
<input type="text" class="form-control" name="host_url[]" value="<?=$aliasurl;?>"/> <input type="text" class="form-control" name="host_url[]" value="<?=$aliasurl;?>"/>
</td> </td>
<td> <td>
<input type="text" class="form-control" name="detail[]" value="<?= isset($detail_desc[$aliasid])?$detail_desc[$aliasid]:"";?>"> <input type="text" class="form-control" name="detail[]" value="<?= isset($detail_desc[$aliasid])?$detail_desc[$aliasid]:"";?>">
</td> </td>
<td> <td>
<?php if ($aliasid ==0): <?php if ($aliasid ==0):
?> ?>
<input type="text" class="form-control input-sm" id="updatefreq" name="updatefreq" value="<?=$pconfig['updatefreq'];?>" > <input type="text" class="form-control input-sm" id="updatefreq" name="updatefreq" value="<?=$pconfig['updatefreq'];?>" >
<?php endif; <?php endif;
?> ?>
</td> </td>
</tr> </tr>
<?php endforeach; <?php endforeach;
else: else:
$detail_desc = explode("||", $pconfig['detail']); $detail_desc = explode("||", $pconfig['detail']);
if (empty($pconfig['address']) && isset($pconfig['url'])) { if (empty($pconfig['address']) && isset($pconfig['url'])) {
$addresslst = array($pconfig['url']); $addresslst = array($pconfig['url']);
} else { } else {
$addresslst = explode(' ', $pconfig['address']); $addresslst = explode(' ', $pconfig['address']);
} }
foreach ($addresslst as $addressid => $address): foreach ($addresslst as $addressid => $address):
?> ?>
<tr> <tr>
<td> <td>
<div style="cursor:pointer;" class="act-removerow btn btn-default btn-xs" alt="remove"><span class="glyphicon glyphicon-minus"></span></div> <div style="cursor:pointer;" class="act-removerow btn btn-default btn-xs" alt="remove"><span class="glyphicon glyphicon-minus"></span></div>
</td> </td>
<td> <td>
<input type="text" class="fld_detail" name="host_url[]" value="<?=$address;?>"/> <input type="text" class="fld_detail" name="host_url[]" value="<?=$address;?>"/>
</td> </td>
<td> <td>
<input type="text" name="detail[]" value="<?= isset($detail_desc[$addressid])?$detail_desc[$addressid]:"";?>"/> <input type="text" name="detail[]" value="<?= isset($detail_desc[$addressid])?$detail_desc[$addressid]:"";?>"/>
</td> </td>
<td> <td>
<?php if ($addressid ==0): <?php if ($addressid ==0):
?> ?>
<input type="text" class="input-sm" id="updatefreq" name="updatefreq" value="<?=$pconfig['updatefreq'];?>"/> <input type="text" class="input-sm" id="updatefreq" name="updatefreq" value="<?=$pconfig['updatefreq'];?>"/>
<?php endif; <?php endif;
?> ?>
</td> </td>
</tr> </tr>
<?php endforeach; <?php endforeach;
endif; endif;
?> ?>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<div id="addNew" style="cursor:pointer;" class="btn btn-default btn-xs" alt="add"><span class="glyphicon glyphicon-plus"></span></div> <div id="addNew" style="cursor:pointer;" class="btn btn-default btn-xs" alt="add"><span class="glyphicon glyphicon-plus"></span></div>
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<input id="submit" name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <input id="submit" name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" /> <input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
</td> </td>
</tr> </tr>
</table> </table>
</div> </form>
</form>
</div>
</div> </div>
</section> </section>
</div> </div>
......
...@@ -153,67 +153,63 @@ include("head.inc"); ...@@ -153,67 +153,63 @@ include("head.inc");
<div class="row"> <div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box tab-content">
<header class="content-box-head container-fluid"> <form action="firewall_aliases_import.php" method="post" name="iform">
<h3><?=gettext("Alias Import");?></h3> <table class="table table-striped">
</header> <tr>
<div class="content-box-main"> <td width="22%"><strong><?=gettext("Alias Import");?></strong></td>
<form action="firewall_aliases_import.php" method="post" name="iform"> <td width="78%" align="right">
<table class="table table-striped"> <small><?=gettext("full help"); ?> </small>
<tr> <i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i>
<td colspan="2" align="right"> </td>
<small><?=gettext("full help"); ?> </small> </tr>
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i> <tr>
</td> <td width="22%"><a id="help_for_name" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Alias Name"); ?></td>
</tr> <td width="78%">
<tr> <input name="name" type="text" class="form-control unknown" size="40" maxlength="31" value="<?=$pconfig['name'];?>" />
<td width="22%"><a id="help_for_name" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Alias Name"); ?></td> <div class="hidden" for="help_for_name">
<td width="78%"> <?=gettext("The name of the alias may only consist of the characters \"a-z, A-Z and 0-9\"."); ?>
<input name="name" type="text" class="form-control unknown" size="40" maxlength="31" value="<?=$pconfig['name'];?>" /> </div>
<div class="hidden" for="help_for_name"> </td>
<?=gettext("The name of the alias may only consist of the characters \"a-z, A-Z and 0-9\"."); ?> </tr>
</div> <tr>
</td> <td><a id="help_for_description" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description"); ?></td>
</tr> <td>
<tr> <input name="descr" type="text" value="<?=$pconfig['descr'];?>" />
<td><a id="help_for_description" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description"); ?></td> <div class="hidden" for="help_for_description">
<td> <?=gettext("You may enter a description here for your reference (not parsed)"); ?>.
<input name="descr" type="text" value="<?=$pconfig['descr'];?>" /> </div>
<div class="hidden" for="help_for_description"> </td>
<?=gettext("You may enter a description here for your reference (not parsed)"); ?>. </tr>
</div> <tr>
</td> <td><a id="help_for_alias" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Aliases to import"); ?></td>
</tr> <td>
<tr> <textarea name="aliasimport" rows="15" cols="40"><?=$pconfig['aliasimport'];?></textarea>
<td><a id="help_for_alias" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Aliases to import"); ?></td> <div class="hidden" for="help_for_alias">
<td> <?=gettext("Paste in the aliases to import separated by a carriage return. Common examples are lists of IPs, networks, blacklists, etc."); ?>
<textarea name="aliasimport" rows="15" cols="40"><?=$pconfig['aliasimport'];?></textarea> <br />
<div class="hidden" for="help_for_alias"> <?=gettext("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.:"); ?>
<?=gettext("Paste in the aliases to import separated by a carriage return. Common examples are lists of IPs, networks, blacklists, etc."); ?> <code>
<br /> <br/>172.16.1.2
<?=gettext("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.:"); ?> <br/>172.16.0.0/24
<code> <br/>10.11.12.100-10.11.12.200
<br/>172.16.1.2 <br/>192.168.1.254 Home router
<br/>172.16.0.0/24 <br/>10.20.0.0/16 Office network
<br/>10.11.12.100-10.11.12.200 <br/>10.40.1.10-10.40.1.19 Managed switches
<br/>192.168.1.254 Home router </code>
<br/>10.20.0.0/16 Office network </div>
<br/>10.40.1.10-10.40.1.19 Managed switches </td>
</code> </tr>
</div> <tr>
</td> <td>&nbsp;</td>
</tr> <td>
<tr> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<td>&nbsp;</td> <input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>"
<td> onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? html_safe($_SERVER['HTTP_REFERER']) : '/firewall_aliases.php');?>'" />
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> </td>
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" </tr>
onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');?>'" /> </table>
</td> </form>
</tr>
</table>
</form>
</div>
</div> </div>
</section> </section>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment