Skip to content

Commit

Permalink
Fix sql errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmr committed Jun 13, 2022
1 parent f3377fa commit 15b44be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions inc/ocsprocess.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1419,12 +1419,15 @@ static function synchronizeComputer($sync_params, $transfer = true) {
// Update OCS Cheksum
$oldChecksum = $ocsClient->getChecksum($line['ocsid']);
$newchecksum = $oldChecksum - $mixed_checksum;
if (isset($computer_ocs['OFFICEPACK'])) {
$ocsClient->setChecksum($newchecksum | PluginOcsinventoryngOcsClient::CHECKSUM_SOFTWARE, $line['ocsid']);
} else {
$ocsClient->setChecksum($newchecksum, $line['ocsid']);
if ($newchecksum > 0) {
if (isset($computer_ocs['OFFICEPACK'])) {
$ocsClient->setChecksum($newchecksum | PluginOcsinventoryngOcsClient::CHECKSUM_SOFTWARE, $line['ocsid']);
} else {
$ocsClient->setChecksum($newchecksum, $line['ocsid']);
}
}


//Return code to indicate that computer was synchronized
return ['status' => self::COMPUTER_SYNCHRONIZED,
'entities_id' => $comp->fields["entities_id"],
Expand Down
2 changes: 1 addition & 1 deletion scripts/ocsng_fullsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
$fields["start_time"] = date("Y-m-d H:i:s");
$fields["threadid"] = $threadid;
$fields["status"] = PLUGIN_OCSINVENTORYNG_STATE_STARTED;
$fields["plugin_ocsinventoryng_ocsservers_id"] = $ocsservers_id;
$fields["plugin_ocsinventoryng_ocsservers_id"] = $plugin_ocsinventoryng_ocsservers_id;
$fields["imported_machines_number"] = 0;
$fields["synchronized_machines_number"] = 0;
$fields["not_unique_machines_number"] = 0;
Expand Down

0 comments on commit 15b44be

Please sign in to comment.