summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/vpn_ipsec.php
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-10-29 14:57:53 -0400
committerStephen Beaver <sbeaver@netgate.com>2015-10-29 14:58:22 -0400
commit1b6b7fc4c24d426d1495fb7b414baba74d876533 (patch)
tree96c3c7992c728c73f35b6723b051150071322a7d /src/usr/local/www/vpn_ipsec.php
parent039607d1ba3d351b566b8eb295f66c24dbdfdbbc (diff)
downloadpfsense-1b6b7fc4c24d426d1495fb7b414baba74d876533.zip
pfsense-1b6b7fc4c24d426d1495fb7b414baba74d876533.tar.gz
Completed #5357
Diffstat (limited to 'src/usr/local/www/vpn_ipsec.php')
-rw-r--r--src/usr/local/www/vpn_ipsec.php92
1 files changed, 60 insertions, 32 deletions
diff --git a/src/usr/local/www/vpn_ipsec.php b/src/usr/local/www/vpn_ipsec.php
index 520e0b0..d74a6d0 100644
--- a/src/usr/local/www/vpn_ipsec.php
+++ b/src/usr/local/www/vpn_ipsec.php
@@ -83,6 +83,7 @@ $a_phase2 = &$config['ipsec']['phase2'];
$pconfig['enable'] = isset($config['ipsec']['enable']);
if ($_POST) {
+
if ($_POST['apply']) {
$retval = 0;
$retval = vpn_ipsec_configure();
@@ -284,7 +285,7 @@ display_top_tabs($tab_array);
}
?>
-<form method="post">
+<form name="mainform" method="post">
<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\"";?> />&nbsp;&nbsp;<?=gettext("Enable IPsec")?><br /><br />
<input name="submit" type="submit" class="btn btn-sm btn-primary" value="<?=gettext("Save"); ?>" /><br /><br />
@@ -296,13 +297,13 @@ display_top_tabs($tab_array);
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
- <th><?=gettext("IKE"); ?></th>
- <th><?=gettext("Remote Gateway"); ?></th>
- <th><?=gettext("Mode"); ?></th>
- <th><?=gettext("P1 Protocol"); ?></th>
- <th><?=gettext("P1 Transforms"); ?></th>
- <th><?=gettext("P1 Description"); ?></th>
- <th></th>
+ <th><?=gettext("IKE")?></th>
+ <th><?=gettext("Remote Gateway")?></th>
+ <th><?=gettext("Mode")?></th>
+ <th><?=gettext("P1 Protocol")?></th>
+ <th><?=gettext("P1 Transforms")?></th>
+ <th><?=gettext("P1 Description")?></th>
+ <th><?=gettext("Actions")?></th>
</tr>
</thead>
<tbody class="p1-entries">
@@ -316,7 +317,7 @@ display_top_tabs($tab_array);
$iconfn .= "_d";
}
?>
- <tr id="fr<?=$i?>" ondblclick="document.location='vpn_ipsec_phase1.php?p1index=<?=$i?>'" class="<?= $entryStatus ?>">
+ <tr id="fr<?=$i?>" onclick="fr_toggle(<?=$i?>)" id="frd<?=$i?>" ondblclick="document.location='vpn_ipsec_phase1.php?p1index=<?=$i?>'" class="<?= $entryStatus ?>">
<td>
<input type="checkbox" id="frc<?=$i?>" name="p1entry[]" value="<?=$i?>" onclick="fr_bgcolor('<?=$i?>')" />
</td>
@@ -331,7 +332,7 @@ display_top_tabs($tab_array);
echo "V2";
?>
</td>
- <td onclick="fr_toggle(<?=$i?>)" id="frd<?=$i?>">
+ <td>
<?php
if ($ph1ent['interface']) {
$iflabels = get_configured_interface_with_descr();
@@ -388,14 +389,16 @@ display_top_tabs($tab_array);
<td>
<?=htmlspecialchars($ph1ent['descr'])?>
</td>
- <td>
- <?php // TODO: add mouseover behaviour which indicates insert position when moving ?>
- <button class="btn btn-xs btn-default" type="submit" name="move_<?=$i?>" value="move_<?=$i?>"><?=gettext("Move checked entries to here")?></button>
- <a class="btn btn-xs btn-primary" href="vpn_ipsec_phase1.php?p1index=<?=$i?>" title="<?=gettext("edit phase1 entry"); ?>">edit</a>
- <button class="btn btn-xs btn-danger" type="submit" name="del_<?=$i?>" value="del_<?=$i?>" title="<?=gettext('delete phase1 entry'); ?>">delete</button>
- <?php if (!isset($ph1ent['mobile'])): ?>
- <a class="btn btn-xs btn-success" href="vpn_ipsec_phase1.php?dup=<?=$i?>" title="<?=gettext("copy phase1 entry"); ?>">copy</a>
- <?php endif; ?>
+ <td style="cursor: pointer;">
+ <a class="fa fa-anchor" id="Xmove_<?=$i?>" title="<?=gettext("Move checked entries to here")?>"></a>
+ <button style="display: none;" class="btn btn-default btn-xs" type="submit" id="move_<?=$i?>" name="move_<?=$i?>" value="move_<?=$i?>"><?=gettext("Move checked entries to here")?></button>
+ <a class="fa fa-pencil" href="vpn_ipsec_phase1.php?p1index=<?=$i?>" title="<?=gettext("Edit phase1 entry"); ?>"></a>
+<?php if (!isset($ph1ent['mobile'])): ?>
+ <a class="fa fa-clone" href="vpn_ipsec_phase1.php?dup=<?=$i?>" title="<?=gettext("Copy phase1 entry"); ?>"></a>
+<?php endif; ?>
+ <a class="fa fa-trash" id="Xdel_<?=$i?>" title="<?=gettext('Delete phase1 entry'); ?>"></a>
+ <button style="display: none;" class="btn btn-xs btn-warning" type="submit" id="del_<?=$i?>" name="del_<?=$i?>" value="del_<?=$i?>" title="<?=gettext('Delete phase1 entry'); ?>">delete</button>
+
</td>
</tr>
<tr class="<?= $entryStatus ?>">
@@ -434,7 +437,7 @@ display_top_tabs($tab_array);
<th><?=gettext("P2 Protocol"); ?></th>
<th><?=gettext("P2 Transforms"); ?></th>
<th><?=gettext("P2 Auth Methods"); ?></th>
- <th>&nbsp;</th>
+ <th><?=gettext("P2 actions")?></th>
</tr>
</thead>
<tbody class="p2-entries">
@@ -502,12 +505,12 @@ display_top_tabs($tab_array);
}
?>
</td>
- <td>
- <?php // TODO: add mouseover behaviour which indicates insert position when moving ?>
- <button class="btn btn-xs btn-default" type="submit" name="movep2_<?=$j?>" value="movep2_<?=$j?>"><?=gettext("Move checked P2s here")?></button>
- <a class="btn btn-xs btn-primary" href="vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid']?>" title="<?=gettext("edit phase2 entry"); ?>">edit</a>
- <button class="btn btn-xs btn-danger" type="submit" name="delp2_<?=$ph2index?>" value="delp2_<?=$ph2index?>" title="<?=gettext('delete phase2 entry'); ?>">delete</button>
- <a class="btn btn-xs btn-success" href="vpn_ipsec_phase2.php?dup=<?=$ph2ent['uniqid']?>" title="<?=gettext("add a new Phase 2 based on this one"); ?>">copy</a>
+ <td style="cursor: pointer;">
+ <!-- <button class="btn btn-xs btn-default" type="submit" name="movep2_<?=$j?>" value="movep2_<?=$j?>"><?=gettext("Move checked P2s here")?></button> -->
+ <a class="fa fa-pencil" href="vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid']?>" title="<?=gettext("Edit phase2 entry"); ?>"></a>
+ <a class="fa fa-clone" href="vpn_ipsec_phase2.php?dup=<?=$ph2ent['uniqid']?>" title="<?=gettext("Add a new Phase 2 based on this one"); ?>"></a>
+ <a class="fa fa-trash" id="Xdelp2_<?=$i?>" title="<?=gettext('Delete phase2 entry'); ?>"></a>
+ <button style="display: none;" class="btn btn-xs btn-warning" type="submit" id="delp2_<?=$ph2index?>" name="delp2_<?=$ph2index?>" value="delp2_<?=$ph2index?>" title="<?=gettext('delete phase2 entry'); ?>">delete</button>
</td>
</tr>
<?php $j++; endforeach; ?>
@@ -515,6 +518,7 @@ display_top_tabs($tab_array);
<td colspan="8"></td>
<td>
<?php
+/*
if ($j == 0):
?>
<i class="icon icon-arrow-down" title="<?=gettext("move selected phase2 entries to end")?>" alt="move"></i>
@@ -524,11 +528,12 @@ display_top_tabs($tab_array);
<i class="icon icon-arrow-down" name="movep2_<?=$j?>" onmouseover="fr_insline(<?=$j?>, true, '<?=$fr_prefix?>')" onmouseout="fr_insline(<?=$j?>, false, '<?=$fr_prefix?>')" title="<?=gettext("move selected phase2 entries to end")?>" alt="move"></i>
<?php
endif;
+*/
?>
- <a href="vpn_ipsec_phase2.php?ikeid=<?=$ph1ent['ikeid']?><?php if (isset($ph1ent['mobile'])) echo "&amp;mobile=true"?>">
- <i class="icon icon-plus-sign" title="<?=gettext("add phase2 entry"); ?>" alt="add"></i>
+ <a class="btn btn-xs btn-success" href="vpn_ipsec_phase2.php?ikeid=<?=$ph1ent['ikeid']?><?php if (isset($ph1ent['mobile'])) echo "&amp;mobile=true"?>"><?=gettext("Add phase2 entry"); ?>
</a>
<?php
+/*
if ($j == 0):
?>
<i class="icon icon-remove-sign" title="<?=gettext("delete selected phase2 entries")?>" alt="delete"></i>
@@ -538,6 +543,7 @@ display_top_tabs($tab_array);
<i name="delp2" class="icon icon-remove-sign" title="<?=gettext("delete selected phase2 entries")?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected phase2 entries?")?>')"></i>
<?php
endif;
+*/
?>
</td>
</tr>
@@ -556,12 +562,16 @@ display_top_tabs($tab_array);
</div>
<nav class="action-buttons">
-<?php if ($i !== 0): ?>
+<?php
+/*
+ if ($i !== 0): ?>
<input type="submit" name="move_<?=$i?>" class="btn btn-default" value="<?=gettext("move selected phase1 entries to end")?>" />
-<?php endif; ?>
- <a href="vpn_ipsec_phase1.php" class="btn btn-success"><?=gettext("add new phase1")?></a>
+<?php endif;
+*/
+?>
+ <a href="vpn_ipsec_phase1.php" class="btn btn-success"><?=gettext("Add new P1")?></a>
<?php if ($i !== 0): ?>
- <input type="submit" name="del" class="btn btn-danger" value="<?=gettext("delete selected phase1 entries")?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected phase1 entries?")?>')" />
+ <input type="submit" name="del" class="btn btn-danger" value="<?=gettext("Delete selected P1s")?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected phase1 entries?")?>')" />
<?php endif; ?>
</nav>
</form>
@@ -573,7 +583,6 @@ display_top_tabs($tab_array);
<?=gettext("IPsec can be set to prefer older SAs at"); ?> <a href="vpn_ipsec_settings.php"><?=gettext("VPN:IPsec:Advanced Settings"); ?></a>.
</div>
-<?php include("foot.inc"); ?>
<script type="text/javascript">
//<![CDATA[
function show_phase2(id, buttonid) {
@@ -591,6 +600,25 @@ events.push(function() {
$('#order-store').removeAttr('disabled');
}
});
+
+ $('[id^=Xmove_]').click(function (event) {
+ $('#' + event.target.id.slice(1)).click();
+ });
+
+ $('[id^=Xdel_]').click(function (event) {
+ if(confirm("<?=gettext('Are you sure you wish to delete this P1 entry?')?>")) {
+ $('#' + event.target.id.slice(1)).click();
+ }
+ });
+
+ $('[id^=Xdelp2_]').click(function (event) {
+ if(confirm("<?=gettext('Are you sure you wish to delete this P2 entry?')?>")) {
+ $('#' + event.target.id.slice(1)).click();
+ }
+ });
});
//]]>
</script>
+
+<?php
+include("foot.inc");
OpenPOWER on IntegriCloud