Skip to content

Commit

Permalink
openvpn: pro tip by @AdSchellevis
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Aug 14, 2023
1 parent ee44967 commit 42e06c5
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

use OPNsense\Base\FieldTypes\BaseListField;
use OPNsense\Core\Config;
use OPNsense\OpenVPN\OpenVPN;

/**
* @package OPNsense\Base\FieldTypes
Expand All @@ -53,7 +52,7 @@ protected function actionPostLoadingEvent()
self::$internalCacheOptionList[(string)$server->vpnid] = $label;
}
}
foreach ((new OpenVPN())->Instances->Instance->iterateItems() as $node_uuid => $node) {
foreach ($this->getParentModel()->Instances->Instance->iterateItems() as $node_uuid => $node) {
if ((string)$node->role == 'server') {
self::$internalCacheOptionList[$node_uuid] = (string)$node->description . ' (' . (!empty((string)$node->port) ? (string)$node->port : '1194') . ' / ' . strtoupper((string)$node->proto) . ')';
}
Expand Down

0 comments on commit 42e06c5

Please sign in to comment.