From 94ce37f578191adb95b95e028323e06b2deb1f14 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 26 Apr 2017 15:20:20 +0200 Subject: [PATCH] security/acme-client: fix $backend is not declared, closes #132 --- .../opnsense/scripts/OPNsense/AcmeClient/certhelper.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 847e273e6..b5cfcd0b3 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -421,6 +421,9 @@ function run_acme_validation($certObj, $valObj, $acctObj) { global $options; + // Required to run pre-defined commands. + $backend = new Backend(); + // Collect account information $account_conf_dir = "/var/etc/acme-client/accounts/" . $acctObj->id; $account_conf_file = $account_conf_dir . "/account.conf"; @@ -961,6 +964,9 @@ function run_restart_actions($certlist, $modelObj) $return = 0; $configObj = Config::getInstance()->object(); + // Required to run pre-defined commands. + $backend = new Backend(); + // NOTE: Do NOT run any restart action twice, collect duplicates first. $restart_actions = array(); @@ -1001,8 +1007,6 @@ function run_restart_actions($certlist, $modelObj) // Run the collected restart actions. if (!empty($restart_actions) and is_array($restart_actions)) { - // Required to run pre-defined commands. - $backend = new Backend(); // Extract cert object foreach ($restart_actions as $action) { // Run pre-defined or custom command?