summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local')
-rw-r--r--usr/local/www/vpn_openvpn_server.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php
index 0777cb6..cb381564 100644
--- a/usr/local/www/vpn_openvpn_server.php
+++ b/usr/local/www/vpn_openvpn_server.php
@@ -370,7 +370,7 @@ if ($_POST) {
if ($_POST['disable'] == "yes")
$server['disable'] = true;
$server['mode'] = $pconfig['mode'];
- if (!empty($pconfig['authmode']))
+ if (!empty($pconfig['authmode']) && (($pconfig['mode'] == "server_user") || ($pconfig['mode'] == "server_tls_user")))
$server['authmode'] = implode(",", $pconfig['authmode']);
$server['protocol'] = $pconfig['protocol'];
$server['dev_mode'] = $pconfig['dev_mode'];
@@ -798,9 +798,13 @@ if ($savemsg)
<td width="22%" valign="top" class="vncellreq"><?=gettext("Backend for authentication");?></td>
<td width="78%" class="vtable">
<select name='authmode[]' id='authmode' class="formselect" multiple="multiple" size="<?php echo count($auth_servers); ?>">
- <?php $authmodes = explode(",", $pconfig['authmode']); ?>
<?php
+ $authmodes = explode(",", $pconfig['authmode']);
$auth_servers = auth_get_authserver_list();
+ // If no authmodes set then default to selecting the first entry in auth_servers
+ if (empty($authmodes[0]) && !empty(key($auth_servers)))
+ $authmodes[0] = key($auth_servers);
+
foreach ($auth_servers as $auth_server_key => $auth_server):
$selected = "";
if (in_array($auth_server_key, $authmodes))
OpenPOWER on IntegriCloud