diff options
author | jim-p <jimp@pfsense.org> | 2010-11-04 14:30:50 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-11-04 14:30:50 -0400 |
commit | 428e66b61b7a511e059ad836f33367837288b71c (patch) | |
tree | ad912584793682f739a83ab42a047f02465fdfc5 /usr | |
parent | 9882cbef8e990c82498152d6831b91b27cfd0240 (diff) | |
download | pfsense-428e66b61b7a511e059ad836f33367837288b71c.zip pfsense-428e66b61b7a511e059ad836f33367837288b71c.tar.gz |
Warn a user when entering the OpenVPN client/server screens that they need a CA/Cert if none exist.
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/vpn_openvpn_client.php | 34 | ||||
-rw-r--r-- | usr/local/www/vpn_openvpn_server.php | 36 |
2 files changed, 57 insertions, 13 deletions
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() { //--> </script> <?php - if ($input_errors) - print_input_errors($input_errors); - if ($savemsg) - print_info_box($savemsg); +if (!$savemsg) + $savemsg = ""; +if (count($a_ca) == 0) + $savemsg .= "You have no Certificate Authorities defined. You must visit the <a href=\"system_camanager.php\">Certificate Manager</a> to make one."; +if (count($a_cert) == 0) + $savemsg .= "<br/>You have no Certificates defined. You must visit the <a href=\"system_camanager.php\">Certificate Manager</a> to make one."; + +if ($input_errors) + print_input_errors($input_errors); +if ($savemsg) + print_info_box($savemsg); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> @@ -610,7 +632,7 @@ function autotls_change() { <td width="78%" class="vtable"> <select name='caref' class="formselect"> <?php - foreach ($config['ca'] as $ca): + foreach ($a_ca as $ca): $selected = ""; if ($pconfig['caref'] == $ca['refid']) $selected = "selected"; @@ -625,7 +647,7 @@ function autotls_change() { <td width="78%" class="vtable"> <select name='certref' class="formselect"> <?php - foreach ($config['cert'] as $cert): + foreach ($a_cert as $cert): $selected = ""; $caname = ""; $inuse = ""; diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php index ca6c261..f5555dc 100644 --- a/usr/local/www/vpn_openvpn_server.php +++ b/usr/local/www/vpn_openvpn_server.php @@ -46,6 +46,21 @@ if (!is_array($config['openvpn']['openvpn-server'])) $a_server = &$config['openvpn']['openvpn-server']; +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']; @@ -526,10 +541,17 @@ function netbios_change() { //--> </script> <?php - if ($input_errors) - print_input_errors($input_errors); - if ($savemsg) - print_info_box($savemsg); +if (!$savemsg) + $savemsg = ""; +if (count($a_ca) == 0) + $savemsg .= "You have no Certificate Authorities defined. You must visit the <a href=\"system_camanager.php\">Certificate Manager</a> to make one."; +if (count($a_cert) == 0) + $savemsg .= "<br/>You have no Certificates defined. You must visit the <a href=\"system_camanager.php\">Certificate Manager</a> to make one."; + +if ($input_errors) + print_input_errors($input_errors); +if ($savemsg) + print_info_box_np($savemsg); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> @@ -716,7 +738,7 @@ function netbios_change() { <td width="78%" class="vtable"> <select name='caref' class="formselect"> <?php - foreach ($config['ca'] as $ca): + foreach ($a_ca as $ca): $selected = ""; if ($pconfig['caref'] == $ca['refid']) $selected = "selected"; @@ -732,7 +754,7 @@ function netbios_change() { <select name='crlref' class="formselect"> <option value="">None</option> <?php - foreach ($config['crl'] as $crl): + foreach ($a_crl as $crl): if (is_crl_internal($crl) && (count($crl['cert']) <= 0)) continue; $selected = ""; @@ -749,7 +771,7 @@ function netbios_change() { <td width="78%" class="vtable"> <select name='certref' class="formselect"> <?php - foreach ($config['cert'] as $cert): + foreach ($a_cert as $cert): $selected = ""; $caname = ""; $inuse = ""; |