Commit 9496a84b authored by Ad Schellevis's avatar Ad Schellevis

Revert "(legacy) move ipsec_idinfo_to_text into vpn_ipsec.conf, move copyright...

Revert "(legacy) move ipsec_idinfo_to_text into vpn_ipsec.conf, move copyright notice with it and cleanup some spacing"

This reverts commit 96e8bd4c.
parent 96e8bd4c
...@@ -156,6 +156,34 @@ function ipsec_idinfo_to_cidr(& $idinfo, $addrbits = false, $mode = "") { ...@@ -156,6 +156,34 @@ 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-2016 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
Copyright (C) 2007 Scott Ullrich 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");
...@@ -36,36 +35,6 @@ require_once("services.inc"); ...@@ -36,36 +35,6 @@ 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();
} }
...@@ -280,19 +249,19 @@ include("head.inc"); ...@@ -280,19 +249,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);
} }
...@@ -300,23 +269,23 @@ function show_phase2(id, buttonid) { ...@@ -300,23 +269,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
...@@ -582,26 +551,26 @@ endforeach; ...@@ -582,26 +551,26 @@ 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 phase1 entries to end");?>" title="<?=gettext("move selected phase1 entries to end");?>"
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>
<a href="vpn_ipsec_phase1.php" title="<?=gettext("add new phase1");?>" alt="add" class="btn btn-default btn-xs"> <a href="vpn_ipsec_phase1.php" title="<?=gettext("add new phase1");?>" alt="add" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-plus"></span> <span class="glyphicon glyphicon-plus"></span>
</a> </a>
<button <button
name="del_x" name="del_x"
type="submit" type="submit"
title="<?=gettext("delete selected phase1 entries");?>" title="<?=gettext("delete selected phase1 entries");?>"
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>
</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