diff options
author | Simon Rettberg | 2023-11-14 14:47:55 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-11-14 14:47:55 +0100 |
commit | 06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 (patch) | |
tree | 7e5493b102074672d8cfd8fe1a61e49f080edbe8 /modules-available/sysconfig/install.inc.php | |
parent | Update phpstorm config (diff) | |
download | slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.gz slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.xz slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.zip |
Add function param/return types, fix a lot more phpstorm complaints
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; } |