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

Commit

Permalink
fix(cron): Escape database name in CentACL 21.10.x (#11509)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyahiaoui-ext authored Aug 4, 2022
1 parent d602637 commit 507a256
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 507a256

Please sign in to comment.