Skip to content

Commit

Permalink
fix: Cleanup HARDWARE inventory section from LASTLOGGEDUSER if required
Browse files Browse the repository at this point in the history
Closes #748
  • Loading branch information
g-bougard committed Aug 28, 2024
1 parent a7a3c21 commit 7b8a5f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ inventory:
on Windows Server OS.
* fix #716: Don't fail on regexp error while running from a user folder which contains
a parenthesis
* fix #748: Don't include lastloggeduser in hardware section in partial inventory
if users section is being deleted after no change detected

netdiscovery/netinventory:
* Skip Konica printers firmware with "Registered" set as version
Expand Down
6 changes: 6 additions & 0 deletions lib/GLPI/Agent/Inventory.pm
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,12 @@ sub computeChecksum {
# For software category, GLPI requires we also keep os category
next if $section eq 'OPERATINGSYSTEM' && $keep_os;
delete $self->{content}->{$section};
# For user category, we must also clean up LASTLOGGEDUSER & DATELASTLOGGEDUSER
# from always kept HARDWARE section to not confuse server
if ($section eq 'USERS') {
delete $self->{content}->{HARDWARE}->{LASTLOGGEDUSER};
delete $self->{content}->{HARDWARE}->{DATELASTLOGGEDUSER};
}
}
$self->isPartial(1);
}
Expand Down

0 comments on commit 7b8a5f0

Please sign in to comment.