Skip to content

Commit

Permalink
VPN: OpenVPN: Instances - properly map user groups for authentication…
Browse files Browse the repository at this point in the history
… to align with legacy code. closes #6732
  • Loading branch information
AdSchellevis committed Aug 10, 2023
1 parent aa81bbd commit 8f51311
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/opnsense/mvc/app/models/OPNsense/OpenVPN/OpenVPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,16 @@ public function getInstanceById($server_id, $role = null)
}
}
}
// legacy uses group names, convert key (gid) to current name
$local_group = null;
if (!empty((string)$node->local_group)) {
$local_group = $node->local_group->getNodeData()[(string)$node->local_group]['value'];
}
return [
'role' => (string)$node->role,
'vpnid' => $server_id,
'authmode' => (string)$node->authmode,
'local_group' => (string)$node->local_group,
'local_group' => $local_group,
'strictusercn' => (string)$node->strictusercn,
'dev_mode' => (string)$node->dev_type,
'topology_subnet' => $node->topology == 'subnet' ? '1' : '0',
Expand Down

0 comments on commit 8f51311

Please sign in to comment.