mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
security/stunnel - with the deprecation of __items on our model fields make sure non of our plugins uses the old magic property.
Traversing __items is actually the same as usnig iterateItems(), which should be a valid replacement. ref https://github.com/opnsense/core/commit/fc8890851a87d3041b820d801e6a386b88ee244b cc @swhite2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
PLUGIN_NAME= stunnel
|
||||
PLUGIN_VERSION= 1.0.4
|
||||
PLUGIN_REVISION= 1
|
||||
PLUGIN_COMMENT= Stunnel TLS proxy
|
||||
PLUGIN_MAINTAINER= ad@opnsense.org
|
||||
PLUGIN_DEPENDS= stunnel
|
||||
|
||||
@@ -70,7 +70,7 @@ function stunnel_refresh_crls()
|
||||
{
|
||||
$stunnel = new OPNsense\Stunnel\Stunnel();
|
||||
$configObj = OPNsense\Core\Config::getInstance()->object();
|
||||
foreach ($stunnel->services->service->__items as $service) {
|
||||
foreach ($stunnel->services->service->iterateItems() as $service) {
|
||||
if (!empty((string)$service->enabled) && !empty((string)$service->enableCRL)) {
|
||||
foreach (explode(",", (string)$service->cacert) as $cacert) {
|
||||
$this_ca = null;
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ class ServicesController extends ApiMutableModelControllerBase
|
||||
{
|
||||
// hook service enable status on enabled tunnels
|
||||
$this->getModel()->general->enabled = "0";
|
||||
foreach ($this->getModel()->services->service->__items as $service) {
|
||||
foreach ($this->getModel()->services->service->iterateItems() as $service) {
|
||||
if ((string)$service->enabled == "1") {
|
||||
$this->getModel()->general->enabled = "1";
|
||||
break;
|
||||
|
||||
@@ -37,7 +37,7 @@ $base_path = "/usr/local/etc/stunnel/certs";
|
||||
$stunnel = new Stunnel();
|
||||
$configObj = Config::getInstance()->object();
|
||||
$all_certs = [];
|
||||
foreach ($stunnel->services->service->__items as $service) {
|
||||
foreach ($stunnel->services->service->iterateItems() as $service) {
|
||||
if (!empty((string)$service->enabled)) {
|
||||
$this_uuid = $service->getAttributes()['uuid'];
|
||||
$srv_certid = (string)$service->servercert;
|
||||
|
||||
Reference in New Issue
Block a user