Commit 16503424 authored by Franco Fichtner's avatar Franco Fichtner

firewall: can't change mode, cluster menu features; closes #921

Not really satisfied with the HA split but let's just say it's a
work in progress...
parent b9095a55
...@@ -34,9 +34,8 @@ ...@@ -34,9 +34,8 @@
<Defaults order="50" url="/diag_defaults.php"/> <Defaults order="50" url="/diag_defaults.php"/>
</Firmware> </Firmware>
<HighAvailability order="50" VisibleName="High Availability" cssClass="fa fa-refresh fa-fw"> <HighAvailability order="50" VisibleName="High Availability" cssClass="fa fa-refresh fa-fw">
<Synchronization url="/system_hasync.php"/> <Settings order="100" url="/system_hasync.php"/>
<CARPStatus order="100" VisibleName="CARP Status" url="/carp_status.php"/> <Status order="200" url="/status_habackup.php"/>
<HAStatus order="200" VisibleName="HA backup status" url="/status_habackup.php"/>
</HighAvailability> </HighAvailability>
<Routes order="40" cssClass="fa fa-map-signs fa-fw"> <Routes order="40" cssClass="fa fa-map-signs fa-fw">
<All order="10" url="/system_routes.php"> <All order="10" url="/system_routes.php">
...@@ -164,9 +163,12 @@ ...@@ -164,9 +163,12 @@
<Edit url="/firewall_nat_npt_edit.php*" visibility="hidden"/> <Edit url="/firewall_nat_npt_edit.php*" visibility="hidden"/>
</NPT> </NPT>
</NAT> </NAT>
<VirtualIPs order="50" VisibleName="Virtual IPs" url="/firewall_virtual_ip.php" cssClass="fa fa-clone fa-fw"> <VIP order="50" VisibleName="Virtual IPs" cssClass="fa fa-clone fa-fw">
<VirtualIPEdit url="/firewall_virtual_ip_edit.php*" visibility="hidden"/> <Settings url="/firewall_virtual_ip.php">
</VirtualIPs> <Edit url="/firewall_virtual_ip_edit.php*" visibility="hidden"/>
</Settings>
<Status url="/carp_status.php"/>
</VIP>
<Schedules order="100" url="/firewall_schedule.php" cssClass="fa fa-calendar fa-fw"> <Schedules order="100" url="/firewall_schedule.php" cssClass="fa fa-calendar fa-fw">
<SchedulesEdit url="/firewall_schedule_edit.php*" visibility="hidden"/> <SchedulesEdit url="/firewall_schedule_edit.php*" visibility="hidden"/>
</Schedules> </Schedules>
......
...@@ -338,9 +338,7 @@ $main_buttons = array( ...@@ -338,9 +338,7 @@ $main_buttons = array(
?> ?>
<?php ?> <?php ?>
<tr> <tr>
<td colspan="5"> <td colspan="5"></td>
<?=sprintf(gettext('You can check the status of your CARP Virtual IPs and interfaces %shere%s.'),'<a href="carp_status.php">','</a>')?></span>
</td>
<td> <td>
<a type="submit" id="move_<?=$i;?>" name="move_<?=$i;?>_x" data-toggle="tooltip" title="<?=gettext("move selected virtual IPs to end");?>" class="act_move btn btn-default btn-xs"> <a type="submit" id="move_<?=$i;?>" name="move_<?=$i;?>_x" data-toggle="tooltip" title="<?=gettext("move selected virtual IPs to end");?>" class="act_move btn btn-default btn-xs">
<span class="glyphicon glyphicon-arrow-left"></span> <span class="glyphicon glyphicon-arrow-left"></span>
......
...@@ -103,6 +103,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -103,6 +103,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$reqdfieldsn = array(gettext("Type")); $reqdfieldsn = array(gettext("Type"));
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors); do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
if (isset($id) && $pconfig['mode'] != $a_vip[$id]['mode']) {
$input_errors[] = gettext("Virtual IP mode may not be changed for an existing entry.");
} else {
if (isset($pconfig['subnet'])) { if (isset($pconfig['subnet'])) {
$pconfig['subnet'] = trim($pconfig['subnet']); $pconfig['subnet'] = trim($pconfig['subnet']);
if (!is_ipaddr($pconfig['subnet'])) { if (!is_ipaddr($pconfig['subnet'])) {
...@@ -117,12 +120,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -117,12 +120,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
} }
} }
$natiflist = get_configured_interface_with_descr(); $natiflist = get_configured_interface_with_descr();
foreach ($natiflist as $natif => $natdescr) { foreach ($natiflist as $natif => $natdescr) {
if ($pconfig['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6']))) { if ($pconfig['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6']))) {
$input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP."); $input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP.");
} }
} }
/* ipalias and carp should not use network or broadcast address */ /* ipalias and carp should not use network or broadcast address */
if ($pconfig['mode'] == "ipalias" || $pconfig['mode'] == "carp") { if ($pconfig['mode'] == "ipalias" || $pconfig['mode'] == "carp") {
if (is_ipaddrv4($pconfig['subnet']) && $pconfig['subnet_bits'] != "32") { if (is_ipaddrv4($pconfig['subnet']) && $pconfig['subnet_bits'] != "32") {
...@@ -174,7 +179,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -174,7 +179,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} else if ($pconfig['mode'] != 'ipalias' && $pconfig['interface'] == "lo0") { } else if ($pconfig['mode'] != 'ipalias' && $pconfig['interface'] == "lo0") {
$input_errors[] = gettext("For this type of vip localhost is not allowed."); $input_errors[] = gettext("For this type of vip localhost is not allowed.");
} }
}
if (count($input_errors) == 0) { if (count($input_errors) == 0) {
$vipent = array(); $vipent = array();
...@@ -321,7 +326,7 @@ $( document ).ready(function() { ...@@ -321,7 +326,7 @@ $( document ).ready(function() {
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a id="help_for_mode" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Type');?></td> <td><a id="help_for_mode" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext('Mode');?></td>
<td> <td>
<select id="mode" name="mode" class="selectpicker" data-width="auto" data-live-search="true"> <select id="mode" name="mode" class="selectpicker" data-width="auto" data-live-search="true">
<option value="ipalias" <?=$pconfig['mode'] == "ipalias" ? "selected=\"selected\"" : ""; ?>><?=gettext("IP Alias");?></option> <option value="ipalias" <?=$pconfig['mode'] == "ipalias" ? "selected=\"selected\"" : ""; ?>><?=gettext("IP Alias");?></option>
......
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