From 428e66b61b7a511e059ad836f33367837288b71c Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 4 Nov 2010 14:30:50 -0400 Subject: Warn a user when entering the OpenVPN client/server screens that they need a CA/Cert if none exist. --- usr/local/www/vpn_openvpn_client.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'usr/local/www/vpn_openvpn_client.php') diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index 4b23c95..93eb56c 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -46,6 +46,21 @@ if (!is_array($config['openvpn']['openvpn-client'])) $a_client = &$config['openvpn']['openvpn-client']; +if (!is_array($config['ca'])) + $config['ca'] = array(); + +$a_ca =& $config['ca']; + +if (!is_array($config['cert'])) + $config['cert'] = array(); + +$a_cert =& $config['cert']; + +if (!is_array($config['crl'])) + $config['crl'] = array(); + +$a_crl =& $config['crl']; + $id = $_GET['id']; if (isset($_POST['id'])) $id = $_POST['id']; @@ -331,10 +346,17 @@ function autotls_change() { //--> Certificate Manager to make one."; +if (count($a_cert) == 0) + $savemsg .= "
You have no Certificates defined. You must visit the Certificate Manager to make one."; + +if ($input_errors) + print_input_errors($input_errors); +if ($savemsg) + print_info_box($savemsg); ?> @@ -610,7 +632,7 @@ function autotls_change() {