Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(cron): Escape database name in CentACL 22.04.x #11510

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cron/centAcl.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@
* Remove data from old groups (deleted groups)
*/
$aclGroupToDelete = "SELECT DISTINCT acl_group_id
FROM " . $centreonDbName . ".acl_groups WHERE acl_group_activate = '1'";
$aclGroupToDelete2 = "SELECT DISTINCT acl_group_id FROM " . $centreonDbName . ".acl_res_group_relations";
$pearDB->beginTransaction();
FROM `" . $centreonDbName . "`.acl_groups WHERE acl_group_activate = '1'";
$aclGroupToDelete2 = "SELECT DISTINCT acl_group_id FROM `" . $centreonDbName . "`.acl_res_group_relations";
$pearDBO->beginTransaction();
try {
$pearDBO->query("DELETE FROM centreon_acl WHERE group_id NOT IN (" . $aclGroupToDelete . ")");
$pearDBO->query("DELETE FROM centreon_acl WHERE group_id NOT IN (" . $aclGroupToDelete2 . ")");
$pearDB->commit();
$pearDBO->commit();
} catch (\PDOException $e) {
$pearDB->rollBack();
$pearDBO->rollBack();
$centreonLog->insertLog(
2,
"CentACL CRON: failed to delete old groups relations"
Expand Down