Commit 2de451e3 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) move ipsec_idinfo_to_text into vpn_ipsec.conf, move copyright notice...

(legacy) move ipsec_idinfo_to_text into vpn_ipsec.conf, move copyright notice with it and cleanup some spacing
parent d7e0198b
...@@ -156,34 +156,6 @@ function ipsec_idinfo_to_cidr(& $idinfo, $addrbits = false, $mode = "") { ...@@ -156,34 +156,6 @@ function ipsec_idinfo_to_cidr(& $idinfo, $addrbits = false, $mode = "") {
} }
/*
* Return phase2 idinfo in text format
*/
function ipsec_idinfo_to_text(& $idinfo) {
global $config;
switch ($idinfo['type']) {
case "address":
return $idinfo['address'];
break; /* NOTREACHED */
case "network":
return $idinfo['address']."/".$idinfo['netbits'];
break; /* NOTREACHED */
case "mobile":
return gettext("Mobile Client");
break; /* NOTREACHED */
case "none":
return gettext("None");
break; /* NOTREACHED */
default:
if (!empty($config['interfaces'][$idinfo['type']]))
return convert_friendly_interface_to_friendly_descr($idinfo['type']);
else
return strtoupper($idinfo['type']);
break; /* NOTREACHED */
}
}
/* /*
* Return phase1 association for phase2 * Return phase1 association for phase2
*/ */
......
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2016 Deciso B.V.
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
Copyright (C) 2008 Shrew Soft Inc Copyright (C) 2008 Shrew Soft Inc
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, 1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
...@@ -35,6 +35,35 @@ require_once("services.inc"); ...@@ -35,6 +35,35 @@ require_once("services.inc");
require_once("pfsense-utils.inc"); require_once("pfsense-utils.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
/*
* Return phase2 idinfo in text format
*/
function ipsec_idinfo_to_text(& $idinfo) {
global $config;
switch ($idinfo['type']) {
case "address":
return $idinfo['address'];
break; /* NOTREACHED */
case "network":
return $idinfo['address']."/".$idinfo['netbits'];
break; /* NOTREACHED */
case "mobile":
return gettext("Mobile Client");
break; /* NOTREACHED */
case "none":
return gettext("None");
break; /* NOTREACHED */
default:
if (!empty($config['interfaces'][$idinfo['type']])) {
return convert_friendly_interface_to_friendly_descr($idinfo['type']);
} else {
return strtoupper($idinfo['type']);
}
break; /* NOTREACHED */
}
}
if (!isset($config['ipsec']) || !is_array($config['ipsec'])) { if (!isset($config['ipsec']) || !is_array($config['ipsec'])) {
$config['ipsec'] = array(); $config['ipsec'] = array();
} }
...@@ -249,19 +278,19 @@ include("head.inc"); ...@@ -249,19 +278,19 @@ include("head.inc");
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
function show_phase2(id, buttonid) { function show_phase2(id, buttonid) {
document.getElementById(buttonid).innerHTML=''; document.getElementById(buttonid).innerHTML='';
document.getElementById(id).style.display = "block"; document.getElementById(id).style.display = "block";
var visible = id + '-visible'; var visible = id + '-visible';
document.getElementById(visible).value = "1"; document.getElementById(visible).value = "1";
} }
//]]> //]]>
</script> </script>
<form action="vpn_ipsec.php" method="post"> <form action="vpn_ipsec.php" method="post">
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php <?php
if (isset($savemsg)) { if (isset($savemsg)) {
print_info_box($savemsg); print_info_box($savemsg);
} }
...@@ -269,23 +298,23 @@ function show_phase2(id, buttonid) { ...@@ -269,23 +298,23 @@ function show_phase2(id, buttonid) {
print_info_box_apply(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect.")); print_info_box_apply(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
} }
?> ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td><?=gettext("IKE"); ?></td> <td><?=gettext("IKE"); ?></td>
<td><?=gettext("Remote Gateway"); ?></td> <td><?=gettext("Remote Gateway"); ?></td>
<td><?=gettext("Mode"); ?></td> <td><?=gettext("Mode"); ?></td>
<td><?=gettext("P1 Protocol"); ?></td> <td><?=gettext("P1 Protocol"); ?></td>
<td><?=gettext("P1 Transforms"); ?></td> <td><?=gettext("P1 Transforms"); ?></td>
<td><?=gettext("P1 Description"); ?></td> <td><?=gettext("P1 Description"); ?></td>
<td> <td>
</td> </td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
...@@ -553,29 +582,29 @@ endforeach; ...@@ -553,29 +582,29 @@ endforeach;
$i++; $i++;
endforeach; // $a_phase1 as $ph1ent endforeach; // $a_phase1 as $ph1ent
?> ?>
<tr> <tr>
<td colspan="8"> </td> <td colspan="8"> </td>
<td> <td>
<button name="move_<?=$i;?>_x" <button name="move_<?=$i;?>_x"
type="submit" type="submit"
title="<?=gettext("move selected phase 1 entries to end");?>" title="<?=gettext("move selected phase 1 entries to end");?>"
data-toggle="tooltip" data-placement="left" data-toggle="tooltip" data-placement="left"
class="btn btn-default btn-xs"> class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-arrow-down"></span> <span class="glyphicon glyphicon-arrow-down"></span>
</button> </button>
<button <button
name="del_x" name="del_x"
type="submit" type="submit"
title="<?=gettext("delete selected phase 1 entries");?>" title="<?=gettext("delete selected phase 1 entries");?>"
data-toggle="tooltip" data-placement="left" data-toggle="tooltip" data-placement="left"
onclick="return confirm('<?=gettext("Do you really want to delete the selected phase1 entries?");?>')" onclick="return confirm('<?=gettext("Do you really want to delete the selected phase1 entries?");?>')"
class="btn btn-default btn-xs"> class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-remove"></span> <span class="glyphicon glyphicon-remove"></span>
</button> </button>
<a href="vpn_ipsec_phase1.php" title="<?=gettext("add new phase 1 entry");?>" data-toggle="tooltip" data-placement="left" <a href="vpn_ipsec_phase1.php" title="<?=gettext("add new phase 1 entry");?>" data-toggle="tooltip" data-placement="left"
alt="add" class="btn btn-default btn-xs"> alt="add" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-plus"></span> <span class="glyphicon glyphicon-plus"></span>
</a> </a>
</td> </td>
</tr> </tr>
<tr> <tr>
......
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