diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-06-12 08:59:12 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-06-12 08:59:12 -0300 |
commit | 859a53045631abf3844efda55a3169186618746a (patch) | |
tree | e8bf0c3be87f9cfd107377237031b77f42ef10b2 | |
parent | bd757043118f896a42719f29ac52a40aa65cfc67 (diff) | |
download | pfsense-859a53045631abf3844efda55a3169186618746a.zip pfsense-859a53045631abf3844efda55a3169186618746a.tar.gz |
Fix #3665, show IPSec tunnel description on status page
-rw-r--r-- | etc/inc/ipsec.inc | 24 | ||||
-rw-r--r-- | usr/local/www/diag_ipsec.php | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index a6efa65..2710f9a 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -656,6 +656,30 @@ function ipsec_get_number_of_phase2($ikeid) { return $nbph2; } +function ipsec_get_descr($ikeid) { + global $config; + + if (!isset($config['ipsec']['phase1']) || + !is_array($config['ipsec']['phase1'])) + return ""; + + $descr = ''; + $a_phase1 = $config['ipsec']['phase1']; + foreach ($a_phase1 as $p1) { + if ($p1['ikeid'] == $ikeid) { + $descr = $p1['descr']; + break; + } + } + unset($a_phase1); + + return $descr; +} + +function ipsec_get_descr_by_peerconfig($peerconfig) { + return ipsec_get_descr(substr($peerconfig, strrpos($peerconfig, '-') + 1)); +} + function ipsec_disconnect_mobile($username) { if (empty($username)) return false; diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index 7a19bd4..ad6c463 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -116,7 +116,7 @@ $status = ipsec_smp_dump_status(); ?> <tr> <td class="listlr"> - <?php echo htmlspecialchars($ikesa['peerconfig']);?> + <?php echo htmlspecialchars(ipsec_get_descr_by_peerconfig($ikesa['peerconfig']));?> </td> <td class="listr"> <?php if (!is_array($ikesa['local'])) |