Skip to content

Commit

Permalink
Fix(Inventory): allow to download inventory file only if is_dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz authored and cedric-anne committed Mar 4, 2024
1 parent aab065d commit 8b3c0f0
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/Features/Inventoriable.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,8 @@ public function pre_purgeInventory()
*/
public function getInventoryFileName(bool $prepend_dir_path = true): ?string
{

if ($this->isField('autoupdatesystems_id')) {
$source = new \AutoUpdateSystem();
$source->getFromDBByCrit(['name' => AutoUpdateSystem::NATIVE_INVENTORY]);

if (
!$this->isDynamic()
|| !isset($source->fields['id'])
|| $this->fields['autoupdatesystems_id'] != $source->fields['id']
) {
return null;
}
if (!$this->isDynamic()) {
return null;
}

$inventory_dir_path = GLPI_INVENTORY_DIR . '/';
Expand Down

0 comments on commit 8b3c0f0

Please sign in to comment.