security/acme-client: fix $backend is not declared, closes #132

This commit is contained in:
Frank Wall
2017-04-26 15:20:20 +02:00
parent 8a053f6f39
commit 94ce37f578
@@ -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?