diff options
Diffstat (limited to 'modules-available/sysconfig/install.inc.php')
-rw-r--r-- | modules-available/sysconfig/install.inc.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/modules-available/sysconfig/install.inc.php b/modules-available/sysconfig/install.inc.php index 9d32137c..53882882 100644 --- a/modules-available/sysconfig/install.inc.php +++ b/modules-available/sysconfig/install.inc.php @@ -125,28 +125,28 @@ Module::isAvailable('sysconfig'); $list = ConfigModule::getAll(); $parentTask = null; $configList = []; -if ($list === false) { +if ($list === null) { EventLog::warning('Could not regenerate configs - please do so manually'); } else { - foreach ($list as $ad) { - if ($ad->moduleType() === 'SshConfig') { + foreach ($list as $confMod) { + if ($confMod->moduleType() === 'SshConfig') { // 2020-11-12: Split SshConfig into SshConfig and SshKey - $pubkey = $ad->getData('publicKey'); + $pubkey = $confMod->getData('publicKey'); if (!empty($pubkey)) { - error_log('Legacy module with pubkey ' . $ad->id()); - $key = ConfigModule::getInstance('SshKey'); - if ($key !== false) { + error_log('Legacy module with pubkey ' . $confMod->id()); + $key = ConfigModule::getInstanceOrNull('SshKey'); + if ($key !== null) { $key->setData('publicKey', $pubkey); - if ($key->insert($ad->title())) { + if ($key->insert($confMod->title())) { // Insert worked, remove key from old module, add this module to the same configs $task = $key->generate(false, $parentTask); if ($task !== false) { $parentTask = $task; } error_log('Inserted new module with id ' . $key->id()); - $ad->setData('publicKey', false); - $ad->update(); - $configs = ConfigTgz::getAllForModule($ad->id()); + $confMod->setData('publicKey', false); + $confMod->update(); + $configs = ConfigTgz::getAllForModule($confMod->id()); foreach ($configs as $config) { // Add newly created key-only module to all configs $new = array_merge($config->getModuleIds(), [$key->id()]); @@ -158,9 +158,9 @@ if ($list === false) { } } } - if ($ad->needRebuild()) { + if ($confMod->needRebuild()) { $update[] = UPDATE_DONE; - $task = $ad->generate(false, $parentTask); + $task = $confMod->generate(false, $parentTask); if ($task !== false) { $parentTask = $task; } |