diff options
-rw-r--r-- | config/openvpn-status/openvpn-status.xml | 2 | ||||
-rw-r--r-- | config/openvpn-status/status_openvpn.php | 23 | ||||
-rwxr-xr-x | pkg_config.7.xml | 2 |
3 files changed, 18 insertions, 9 deletions
diff --git a/config/openvpn-status/openvpn-status.xml b/config/openvpn-status/openvpn-status.xml index 4f7a876b..8ef27ded 100644 --- a/config/openvpn-status/openvpn-status.xml +++ b/config/openvpn-status/openvpn-status.xml @@ -46,7 +46,7 @@ <requirements>Management Port Defined in OpenVPN Config</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>OpenVPN Status</name> - <version>1.0</version> + <version>1.3</version> <title>Status: OpenVPN</title> <menu> <name>OpenVPN</name> diff --git a/config/openvpn-status/status_openvpn.php b/config/openvpn-status/status_openvpn.php index 7238c0ca..a021e951 100644 --- a/config/openvpn-status/status_openvpn.php +++ b/config/openvpn-status/status_openvpn.php @@ -1,20 +1,20 @@ -<?php +<?php /* status_ovpenvpn.php Copyright (C) 2008 Shrew Soft Inc. All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE @@ -52,7 +52,7 @@ if (is_array($ovpnservers)) { $errstr; /* open a tcp connection to the management port of each server */ - $fp = fsockopen("127.0.0.1", $port, $errval, $errstr, 1); + $fp = @fsockopen("127.0.0.1", $port, $errval, $errstr, 1); if ($fp) { /* send our status request */ @@ -89,6 +89,15 @@ if (is_array($ovpnservers)) { /* cleanup */ fclose($fp); + } else { + $conn = array(); + $conn['common_name'] = "[error]"; + $conn['remote_host'] = "No Management Daemon"; + $conn['virtual_addr'] = "See Note Below"; + $conn['bytes_recv'] = 0; + $conn['bytes_sent'] = 0; + $conn['connect_time'] = 0; + $server['conns'][] = $conn; } $servers[] = $server; @@ -106,7 +115,7 @@ echo $buff; <table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <td colspan="6" class="listtopic"> + <td colspan="6" class="listtopic"> Client connections for <?=$server['name'];?> </td> </tr> diff --git a/pkg_config.7.xml b/pkg_config.7.xml index 375bbad3..fe30c84e 100755 --- a/pkg_config.7.xml +++ b/pkg_config.7.xml @@ -967,7 +967,7 @@ <name>OpenVPN Status</name> <descr>OpenVPN Status Page, backported from 2.0</descr> <category>System</category> - <version>1.0</version> + <version>1.3</version> <status>Beta</status> <maintainer>jimp@pfsense.org</maintainer> <required_version>1.2.3</required_version> |