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

Commit 94e15aa

Browse files
tuntojachgautieremabassi-extjeremyjaouenNoha-ElAbrouki
authored
chore(release): merge release-22.04.next in 22.04.x (#11911)
* fix(git): resync 22.04.x to dev-22.04.x (#11503) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * fix(cron): Escape database name in CentACL 22.04.x (#11510) * fix(test): wait 8s before checking downtime is active in rest api v1 test (#11498) (#11504) Refs: MON-14585 * fix(UI): Include host_id when selecting ServiceGroups on dashreports (#11428) (#11519) Co-authored-by: VHS <[email protected]> Co-authored-by: VHS <[email protected]> * fix(Resources/Graph): export graph image after selecting png (#11491) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) * fix export graph image after selecting png Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * Fix(platform): Removing appkey key (#11511) * fix(trap): Removal of the restriction on the uniqueness of the OID of a trap (#11327) Currently, an error appears when we try to save an existing trap because a test is performed on the uniqueness of the OID. This PR aims to remove the restriction on the uniqueness of the OID of a trap. * fix(pendo): correctly set locale when language is detection by browser (#11484) (#11528) * fix(test): fix random fails on virtual metric test (#11523) Refs: MON-14359 * fix(autoload): Add classmap to fix autoload with legacy classes (#11492) (#11532) Refs: MON-14496 * fix(ldap): small refacto of ldap authentication and log failures (#11422) (#11534) Refs: MON-7417 * fix(api): allow api platform updates from installed 22.04.0 (#11495) (#11533) Refs: MON-12296 * fix(api): fix call to api on fresh install (#11536) (#11537) Refs: MON-12296 * doc(ack): acknowledge Hakaï security (#11540) * fix(api): do not init db connection in event subscriber (#11543) (#11545) Refs: MON-12296 * fix(web): fix the comment deletion for host monitored by poller (#11138) (#11556) Refs: MON-12828 Co-authored-by: Stéphane Duret <[email protected]> * SNYK: Sanitize and bind ACL actions queries (#11547) * sanitizing and binding acl actions queries * fix missing bind * SNYK: Sanitize and bind Broker listing queries (#11550) * Sanitizing and binding broker listing queries * applying suggested changes * fix(conf) fix encoding in template service listing (#11558) (#11564) * fix encoding * remove useless function * SNYK: Sanitize and bind generateImage queries (#11561) * sanitize and bind generate image queries * adding throw exception * applying suggested changes * Update www/include/views/graphs/generateGraphs/generateImage.php Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: Kevin Duret <[email protected]> * MON-14501 - sanitize query in centreonXmlbgRequest class (#11570) * sanitize query in centreonXmlbgRequest class * add closeCursor func to resolve conv * SNYK: Sanitize and bind Meta-Services dependency queries (#11567) * sanityze 2 insert queries * spaces removed in a query * chore(release):rebase dev-22.04.x on 22.04.x (#11627) * Merge release-22.04.3 into 22.04.x (#11623) * fix(git): resync 22.04.x to dev-22.04.x (#11503) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * fix(cron): Escape database name in CentACL 22.04.x (#11510) * fix(test): wait 8s before checking downtime is active in rest api v1 test (#11498) (#11504) Refs: MON-14585 * fix(UI): Include host_id when selecting ServiceGroups on dashreports (#11428) (#11519) Co-authored-by: VHS <[email protected]> Co-authored-by: VHS <[email protected]> * fix(Resources/Graph): export graph image after selecting png (#11491) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) * fix export graph image after selecting png Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * Fix(platform): Removing appkey key (#11511) * fix(trap): Removal of the restriction on the uniqueness of the OID of a trap (#11327) Currently, an error appears when we try to save an existing trap because a test is performed on the uniqueness of the OID. This PR aims to remove the restriction on the uniqueness of the OID of a trap. * fix(pendo): correctly set locale when language is detection by browser (#11484) (#11528) * fix(test): fix random fails on virtual metric test (#11523) Refs: MON-14359 * fix(autoload): Add classmap to fix autoload with legacy classes (#11492) (#11532) Refs: MON-14496 * fix(ldap): small refacto of ldap authentication and log failures (#11422) (#11534) Refs: MON-7417 * fix(api): allow api platform updates from installed 22.04.0 (#11495) (#11533) Refs: MON-12296 * fix(api): fix call to api on fresh install (#11536) (#11537) Refs: MON-12296 * doc(ack): acknowledge Hakaï security (#11540) * fix(api): do not init db connection in event subscriber (#11543) (#11545) Refs: MON-12296 * fix(web): fix the comment deletion for host monitored by poller (#11138) (#11556) Refs: MON-12828 Co-authored-by: Stéphane Duret <[email protected]> * SNYK: Sanitize and bind ACL actions queries (#11547) * sanitizing and binding acl actions queries * fix missing bind * SNYK: Sanitize and bind Broker listing queries (#11550) * Sanitizing and binding broker listing queries * applying suggested changes * fix(conf) fix encoding in template service listing (#11558) (#11564) * fix encoding * remove useless function * SNYK: Sanitize and bind generateImage queries (#11561) * sanitize and bind generate image queries * adding throw exception * applying suggested changes * Update www/include/views/graphs/generateGraphs/generateImage.php Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: Kevin Duret <[email protected]> * MON-14501 - sanitize query in centreonXmlbgRequest class (#11570) * sanitize query in centreonXmlbgRequest class * add closeCursor func to resolve conv * SNYK: Sanitize and bind Meta-Services dependency queries (#11567) * sanityze 2 insert queries * spaces removed in a query * chore(install):Update version to 22.04.3 * fix(sql): fix query to select contact during ldap import (#11578) Refs: MON-14263 * fix(UI): Fix layout for Safari and form validation (#11373) (#11604) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> Co-authored-by: VHS <[email protected]> Co-authored-by: Laurent Calvet <[email protected]> Co-authored-by: Stéphane Chapron <[email protected]> Co-authored-by: Stéphane Duret <[email protected]> * fix(api): fix call to api on fresh install (#11536) (#11537) Refs: MON-12296 * fix(api): do not init db connection in event subscriber (#11543) (#11545) Refs: MON-12296 Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> Co-authored-by: VHS <[email protected]> Co-authored-by: Laurent Calvet <[email protected]> Co-authored-by: Stéphane Chapron <[email protected]> Co-authored-by: Stéphane Duret <[email protected]> * fix(partition): adapt control of database version (#11609) (#11610) * fix(openid): correctly set contact_location while creating session (#11613) (#11614) * fix(lang): Fixed FR typo (#11621) * enh(UI): Add a “Parent alias“ column on the monitoring resources sta… (#11542) * enh(UI): Add a “Parent alias“ column on the monitoring resources status page (#11190) * Add column ParentAlias * Add new label ParentAlias * Add column ParentAlias and new column component * Add new card to display Parent Alias * Remove tile in Details Panel, enhancement not expected * FIx eslint issue * Fix naming on label parent alias * Add translation * Add line at the end of files * Add line at the end of file * fix issues * Update lang/fr_FR.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Tom Darneix <[email protected]> * Update lang/es_ES.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Tom Darneix <[email protected]> * Update lang/pt_PT.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Tom Darneix <[email protected]> * Update lang/es_ES.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Jérémy Delpierre <[email protected]> * Update lang/pt_BR.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Jérémy Delpierre <[email protected]> * Update lang/fr_FR.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Bruno d'Auria <[email protected]> * Fix issue on messages.po file Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: Jérémy Delpierre <[email protected]> Co-authored-by: Bruno d'Auria <[email protected]> * query sanitized in listServiceCategoriesà (#11597) (#11632) * MON-14797 reorganizes dependencies (#11612) * Fix encoding issue on status serviceXML (#11581) * sanitize and bind in centreon connector query (#11635) * sanitize insrert queries in db-func (#11650) MON-14667 * chore(git): update codeowners (#11594) * chore(release):rebase dev-22.04.x on 22.04.x (#11688) * Merge release-22.04.3 into 22.04.x (#11623) * fix(git): resync 22.04.x to dev-22.04.x (#11503) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * fix(cron): Escape database name in CentACL 22.04.x (#11510) * fix(test): wait 8s before checking downtime is active in rest api v1 test (#11498) (#11504) Refs: MON-14585 * fix(UI): Include host_id when selecting ServiceGroups on dashreports (#11428) (#11519) Co-authored-by: VHS <[email protected]> Co-authored-by: VHS <[email protected]> * fix(Resources/Graph): export graph image after selecting png (#11491) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) * fix export graph image after selecting png Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * Fix(platform): Removing appkey key (#11511) * fix(trap): Removal of the restriction on the uniqueness of the OID of a trap (#11327) Currently, an error appears when we try to save an existing trap because a test is performed on the uniqueness of the OID. This PR aims to remove the restriction on the uniqueness of the OID of a trap. * fix(pendo): correctly set locale when language is detection by browser (#11484) (#11528) * fix(test): fix random fails on virtual metric test (#11523) Refs: MON-14359 * fix(autoload): Add classmap to fix autoload with legacy classes (#11492) (#11532) Refs: MON-14496 * fix(ldap): small refacto of ldap authentication and log failures (#11422) (#11534) Refs: MON-7417 * fix(api): allow api platform updates from installed 22.04.0 (#11495) (#11533) Refs: MON-12296 * fix(api): fix call to api on fresh install (#11536) (#11537) Refs: MON-12296 * doc(ack): acknowledge Hakaï security (#11540) * fix(api): do not init db connection in event subscriber (#11543) (#11545) Refs: MON-12296 * fix(web): fix the comment deletion for host monitored by poller (#11138) (#11556) Refs: MON-12828 Co-authored-by: Stéphane Duret <[email protected]> * SNYK: Sanitize and bind ACL actions queries (#11547) * sanitizing and binding acl actions queries * fix missing bind * SNYK: Sanitize and bind Broker listing queries (#11550) * Sanitizing and binding broker listing queries * applying suggested changes * fix(conf) fix encoding in template service listing (#11558) (#11564) * fix encoding * remove useless function * SNYK: Sanitize and bind generateImage queries (#11561) * sanitize and bind generate image queries * adding throw exception * applying suggested changes * Update www/include/views/graphs/generateGraphs/generateImage.php Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: Kevin Duret <[email protected]> * MON-14501 - sanitize query in centreonXmlbgRequest class (#11570) * sanitize query in centreonXmlbgRequest class * add closeCursor func to resolve conv * SNYK: Sanitize and bind Meta-Services dependency queries (#11567) * sanityze 2 insert queries * spaces removed in a query * chore(install):Update version to 22.04.3 * fix(sql): fix query to select contact during ldap import (#11578) Refs: MON-14263 * fix(UI): Fix layout for Safari and form validation (#11373) (#11604) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> Co-authored-by: VHS <[email protected]> Co-authored-by: Laurent Calvet <[email protected]> Co-authored-by: Stéphane Chapron <[email protected]> Co-authored-by: Stéphane Duret <[email protected]> * chore(release): merge hotfix-MON-14893-index-data (#11681) * fix(upgrade): Correctly Parse SQL Comments (#11658) (#11668) Refs: MON-14848 Co-authored-by: jeremyjaouen <[email protected]> * fix invalid values for index_data.special (#11669) * chore(install):update version to 22.04.4 Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> * fix(api): fix call to api on fresh install (#11536) (#11537) Refs: MON-12296 * fix(api): do not init db connection in event subscriber (#11543) (#11545) Refs: MON-12296 * fix(partition): adapt control of database version (#11609) (#11610) * fix(openid): correctly set contact_location while creating session (#11613) (#11614) * fix(lang): Fixed FR typo (#11621) * enh(UI): Add a “Parent alias“ column on the monitoring resources sta… (#11542) * enh(UI): Add a “Parent alias“ column on the monitoring resources status page (#11190) * Add column ParentAlias * Add new label ParentAlias * Add column ParentAlias and new column component * Add new card to display Parent Alias * Remove tile in Details Panel, enhancement not expected * FIx eslint issue * Fix naming on label parent alias * Add translation * Add line at the end of files * Add line at the end of file * fix issues * Update lang/fr_FR.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Tom Darneix <[email protected]> * Update lang/es_ES.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Tom Darneix <[email protected]> * Update lang/pt_PT.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Tom Darneix <[email protected]> * Update lang/es_ES.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Jérémy Delpierre <[email protected]> * Update lang/pt_BR.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Jérémy Delpierre <[email protected]> * Update lang/fr_FR.UTF-8/LC_MESSAGES/messages.po Co-authored-by: Bruno d'Auria <[email protected]> * Fix issue on messages.po file Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: Jérémy Delpierre <[email protected]> Co-authored-by: Bruno d'Auria <[email protected]> * query sanitized in listServiceCategoriesà (#11597) (#11632) * MON-14797 reorganizes dependencies (#11612) * Fix encoding issue on status serviceXML (#11581) * sanitize and bind in centreon connector query (#11635) * sanitize insrert queries in db-func (#11650) MON-14667 Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> Co-authored-by: VHS <[email protected]> Co-authored-by: Laurent Calvet <[email protected]> Co-authored-by: Stéphane Chapron <[email protected]> Co-authored-by: Stéphane Duret <[email protected]> Co-authored-by: Laurent Pinsivy <[email protected]> Co-authored-by: jcaro <[email protected]> Co-authored-by: Jérémy Delpierre <[email protected]> Co-authored-by: Bruno d'Auria <[email protected]> Co-authored-by: Luiz Costa <[email protected]> Co-authored-by: TamazC <[email protected]> * fix(details): remove dead code (#11672) (#11686) * fix(conf) fix parent template display in service template listing (#11671) (#11676) * fix(poller): fix remote server duplication (#11552) (#11674) * fix(poller): fix remote server duplication (#11552) Refs: MON-14579 Co-authored-by: Jérémy Jaouen <[email protected]> * fix translation for host and service category (#11626) * fix(clapi): Check that user is admin to use clapi (#11631) (#11640) * Sanitized and bound queries in service argumentsXml fil (#11653) MON-14669 * Sanitize and bind listVirtualMetrics queries (#11647) * sanitize and bind host categories queries (#11645) * Ãbind queries an fix array binding(#11656) * fix(ui): fix svg display in legacy monitoring pages (#11659) (#11690) Refs: MON-14869 * Sanitize and bind service group dependecies queries 22.04.x (#11665) * MON-14425 fix centreon.ini and autoconfigure timezone (#11608) * enh(Resources/header): Display the 2 access pictograms logs and report on details panel (#11618) * Display the 2 access pictograms logs and report on details panel * Update www/front_src/src/Resources/Details/Header.tsx Co-authored-by: JKancel <[email protected]> * Update www/front_src/src/Resources/Details/Header.tsx Co-authored-by: JKancel <[email protected]> Co-authored-by: JKancel <[email protected]> * fix(resource-status): add missing alias to Host detail factory (#11642) * fix(widgets): retrieve possibility to not select poller in pref (#11696) (#11698) Refs: MON-14919 * fix(install): fix source install with quiet mode related to gorgone vars (#11694) (#11701) Refs: MON-14806 Co-authored-by: Eric Coquard <[email protected]> * Fix: In Acces group the second select not working [ACL] 22.04.x (#11709) * fix second select not working * applying suggested changes * fix(details): second part of code cleanup for "tools" (#11718) (#11721) * fix (#11724) * FIX: Sanitize and bind graph configuration queries 22.04.x (#11729) * [Fix]:Sanitize and bind queries in template of service listing (#11746) * [Fix]:Sanitize and bind queries in template of service listing * work on tamazC suggestion * fix(resource): Fix bad SQL request (#11702) (#11749) * FIX: Sanitize and bind Meta Service configuration 22.04.x (#11733) * sanitize and bind meta service config * applying suggested changes * Fix: Sanitize and bind CLAPI poller configuration 22.04.x (#11731) * sanitize and bind CLAPI poller config * remove unecessary comment * revert deleted imports * FIX: Sanitize and bind command configuration queries 22.04.x (#11754) * fix(partition): fix condition for database version (#11657) (#11756) Co-authored-by: jeremyjaouen <[email protected]> * Rebase dev2204x on 2204x (#11824) * Merge release-22.04.3 into 22.04.x (#11623) * fix(git): resync 22.04.x to dev-22.04.x (#11503) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * fix(cron): Escape database name in CentACL 22.04.x (#11510) * fix(test): wait 8s before checking downtime is active in rest api v1 test (#11498) (#11504) Refs: MON-14585 * fix(UI): Include host_id when selecting ServiceGroups on dashreports (#11428) (#11519) Co-authored-by: VHS <[email protected]> Co-authored-by: VHS <[email protected]> * fix(Resources/Graph): export graph image after selecting png (#11491) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) * fix export graph image after selecting png Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * Fix(platform): Removing appkey key (#11511) * fix(trap): Removal of the restriction on the uniqueness of the OID of a trap (#11327) Currently, an error appears when we try to save an existing trap because a test is performed on the uniqueness of the OID. This PR aims to remove the restriction on the uniqueness of the OID of a trap. * fix(pendo): correctly set locale when language is detection by browser (#11484) (#11528) * fix(test): fix random fails on virtual metric test (#11523) Refs: MON-14359 * fix(autoload): Add classmap to fix autoload with legacy classes (#11492) (#11532) Refs: MON-14496 * fix(ldap): small refacto of ldap authentication and log failures (#11422) (#11534) Refs: MON-7417 * fix(api): allow api platform updates from installed 22.04.0 (#11495) (#11533) Refs: MON-12296 * fix(api): fix call to api on fresh install (#11536) (#11537) Refs: MON-12296 * doc(ack): acknowledge Hakaï security (#11540) * fix(api): do not init db connection in event subscriber (#11543) (#11545) Refs: MON-12296 * fix(web): fix the comment deletion for host monitored by poller (#11138) (#11556) Refs: MON-12828 Co-authored-by: Stéphane Duret <[email protected]> * SNYK: Sanitize and bind ACL actions queries (#11547) * sanitizing and binding acl actions queries * fix missing bind * SNYK: Sanitize and bind Broker listing queries (#11550) * Sanitizing and binding broker listing queries * applying suggested changes * fix(conf) fix encoding in template service listing (#11558) (#11564) * fix encoding * remove useless function * SNYK: Sanitize and bind generateImage queries (#11561) * sanitize and bind generate image queries * adding throw exception * applying suggested changes * Update www/include/views/graphs/generateGraphs/generateImage.php Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: Kevin Duret <[email protected]> * MON-14501 - sanitize query in centreonXmlbgRequest class (#11570) * sanitize query in centreonXmlbgRequest class * add closeCursor func to resolve conv * SNYK: Sanitize and bind Meta-Services dependency queries (#11567) * sanityze 2 insert queries * spaces removed in a query * chore(install):Update version to 22.04.3 * fix(sql): fix query to select contact during ldap import (#11578) Refs: MON-14263 * fix(UI): Fix layout for Safari and form validation (#11373) (#11604) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> Co-authored-by: VHS <[email protected]> Co-authored-by: Laurent Calvet <[email protected]> Co-authored-by: Stéphane Chapron <[email protected]> Co-authored-by: Stéphane Duret <[email protected]> * chore(release): merge hotfix-MON-14893-index-data (#11681) * fix(upgrade): Correctly Parse SQL Comments (#11658) (#11668) Refs: MON-14848 Co-authored-by: jeremyjaouen <[email protected]> * fix invalid values for index_data.special (#11669) * chore(install):update version to 22.04.4 Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> * chore(release): merge release-22.04.next into 22.04.x (#11821) * fix(git): resync 22.04.x to dev-22.04.x (#11503) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11 * [SNYK] Sanitize and bind centreonGraph class queries (#11409) (#11421) 1122 1153 1134 * [Snyk] Sanitize and bind ACL action access queries (#11385) (#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks * feat(api): implement endpoint to update centreon web (#11391) (#11401) Refs: MON-12296 * Clean(platform): Clean appKey method and usage 22.04.x (#11452) * Clean(platform): Clean appKey method and usage (#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <[email protected]> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <[email protected]> * enh(platform): Use API to select metrics in virtual metrics configuration form 22.04.x (#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag * [SNYK] Sanitize and bind ACL class queries (#11392) (#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters * fix(conf) fix broker conf name display in listing (#11372) (#11376) Co-authored-by: Elmahdi ABBASSI <[email protected]> Co-authored-by: jeremyjaouen <[email protected]> Co-authored-by: Nouha-ElAbrouki <[email protected]> Co-authored-by: Kevin Duret <[email protected]> Co-authored-by: hyahiaoui-ext <[email protected]> Co-authored-by: Tom Darneix <[email protected]> Co-authored-by: alaunois <[email protected]> * fix(cron): Escape database name in CentACL 22.04.x (#11510) * fix(test): wait 8s before checking downtime is active in rest api v1 test (#11498) (#11504) Refs: MON-14585 * fix(UI): Include host_id when selecting ServiceGroups on dashreports (#11428) (#11519) Co-authored-by: VHS <[email protected]> Co-authored-by: VHS <[email protected]> * fix(Resources/Graph): export graph image after selecting png (#11491) * [SNYK] Sanitize and bind ACL host dependency queries (#11389) (#11394) * Sanitize and bind ACL host dependency queries * fix issues * removed old variable userCrypted and the use of it (#11334) (#11352) Co-authored-by: jeremyjaouen <[email protected]> * enh(Header/userMenu):reduce spacing user menu (#11393) * update user menu * fix(hostgroup): fix display of hostgroups in select2 (#11431) (#11443) * fix(ci): fix debian packaging with freshly instanciated jenkins slave (#11398) (#11399) Refs: MON-14377 * Sanitized and bound queries (#11413) (#11445) lines : 130 -142 * Snyk: Sanitize and bind media sync queries 22.04.x (#11418) * sanitizing and binding sync dir file queries * Applying some fixes * Snyk: Sanitize and bind ACL service dependency queries dev-22.04.x (#11395) * Snyk: Sanitize and bind Auth class queries 22.04.x (#11448) * [Backport/need review] fix(UI): Fix layout for Safari and form validation (#11440) * fix(UI): Fix layout for Safari and form validation (#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on n…
1 parent b709503 commit 94e15aa

File tree

52 files changed

+361
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+361
-478
lines changed

src/Centreon/Domain/Contact/Interfaces/ContactInterface.php

+5
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,9 @@ public function hasAccessToApiRealTime(): bool;
207207
* @return static
208208
*/
209209
public function setAccessToApiRealTime(bool $hasAccessToApiRealTime): static;
210+
211+
/**
212+
* @return string|null
213+
*/
214+
public function getTheme(): ?string;
210215
}

src/Centreon/Domain/Repository/TopologyRepository.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,15 @@ public function getReactTopologiesPerUserWithAcl($user)
105105
if ($DBRESULT->rowCount()) {
106106
$topology = array();
107107
$tmp_topo_page = array();
108+
$statement = $this->db->prepare("SELECT topology_topology_id, acl_topology_relations.access_right "
109+
. "FROM acl_topology_relations, acl_topology "
110+
. "WHERE acl_topology.acl_topo_activate = '1' "
111+
. "AND acl_topology.acl_topo_id = acl_topology_relations.acl_topo_id "
112+
. "AND acl_topology_relations.acl_topo_id = :acl_topo_id ");
108113
while ($topo_group = $DBRESULT->fetchRow()) {
109-
$query2 = "SELECT topology_topology_id, acl_topology_relations.access_right "
110-
. "FROM acl_topology_relations, acl_topology "
111-
. "WHERE acl_topology.acl_topo_activate = '1' "
112-
. "AND acl_topology.acl_topo_id = acl_topology_relations.acl_topo_id "
113-
. "AND acl_topology_relations.acl_topo_id = '" . $topo_group["acl_topology_id"] . "' ";
114-
$DBRESULT2 = $this->db->query($query2);
115-
while ($topo_page = $DBRESULT2->fetchRow()) {
114+
$statement->bindValue(':acl_topo_id', $topo_group["acl_topology_id"], \PDO::PARAM_INT);
115+
$statement->execute();
116+
while ($topo_page = $statement->fetch(\PDO::FETCH_ASSOC)) {
116117
$topology[] = (int)$topo_page["topology_topology_id"];
117118
if (!isset($tmp_topo_page[$topo_page['topology_topology_id']])) {
118119
$tmp_topo_page[$topo_page["topology_topology_id"]] = $topo_page["access_right"];
@@ -127,7 +128,7 @@ public function getReactTopologiesPerUserWithAcl($user)
127128
}
128129
}
129130
}
130-
$DBRESULT2->closeCursor();
131+
$statement->closeCursor();
131132
}
132133
$DBRESULT->closeCursor();
133134

src/Centreon/Domain/Service/AppKeyGeneratorService.php

-15
This file was deleted.

src/Centreon/Infrastructure/HostConfiguration/Repository/HostConfigurationRepositoryRDB.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ public function updateHost(Host $host): void
779779
$statement->bindValue(':ip_address', $host->getIpAddress(), \PDO::PARAM_STR);
780780
$statement->bindValue(':comment', $host->getComment(), \PDO::PARAM_STR);
781781
$statement->bindValue(':geo_coords', $host->getGeoCoords(), \PDO::PARAM_STR);
782-
$statement->bindValue(':is_activate', $host->isActivated(), \PDO::PARAM_STR);
782+
$statement->bindValue(':is_activate', $host->isActivated() ? '1' : '0', \PDO::PARAM_STR);
783783
$statement->bindValue(':host_register', '1', \PDO::PARAM_STR);
784784
$statement->bindValue(':active_check_status', Host::OPTION_DEFAULT, \PDO::PARAM_STR);
785785
$statement->bindValue(':passive_check_status', Host::OPTION_DEFAULT, \PDO::PARAM_STR);

src/Centreon/ServiceProvider.php

-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
use Centreon\Infrastructure\Service\CentreonDBManagerService;
3535
use Centreon\Domain\Service\I18nService;
3636
use Centreon\Domain\Service\FrontendComponentService;
37-
use Centreon\Domain\Service\AppKeyGeneratorService;
3837
use Centreon\Domain\Service\BrokerConfigurationService;
3938
use Centreon\Domain\Repository\CfgCentreonBrokerRepository;
4039
use Centreon\Domain\Repository\CfgCentreonBrokerInfoRepository;
@@ -171,12 +170,6 @@ public function register(Container $pimple): void
171170
return $_SESSION['centreon']->user; // @codeCoverageIgnoreEnd
172171
};
173172

174-
$pimple['centreon.keygen'] = function (): AppKeyGeneratorService {
175-
$service = new AppKeyGeneratorService();
176-
177-
return $service;
178-
};
179-
180173
$pimple[static::CENTREON_ACL] = function (Container $container): CentreonACL {
181174
$service = new CentreonACL($container);
182175

src/Centreon/Tests/AppKeyGeneratorServiceTest.php

-63
This file was deleted.

src/Centreon/Tests/Domain/Repository/TopologyRepositoryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function setUp(): void
5252
. "FROM acl_topology_relations, acl_topology "
5353
. "WHERE acl_topology.acl_topo_activate = '1' "
5454
. "AND acl_topology.acl_topo_id = acl_topology_relations.acl_topo_id "
55-
. "AND acl_topology_relations.acl_topo_id = '1' ",
55+
. "AND acl_topology_relations.acl_topo_id = :acl_topo_id ",
5656
'data' => [
5757
[
5858
'topology_topology_id' => 1,

src/Centreon/Tests/ServiceProviderTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public function testCheckServicesByList()
8383
ServiceProvider::CENTREON_DB_MANAGER => Service\CentreonDBManagerService::class,
8484
ServiceProvider::UPLOAD_MANGER => Service\UploadFileService::class,
8585
ServiceProvider::CENTREON_PAGINATION => Service\CentreonPaginationService::class,
86-
'centreon.keygen' => Domain\Service\AppKeyGeneratorService::class,
8786
'centreon.acl' => CentreonACL::class,
8887
'centreon.config' => Service\CentcoreConfigService::class,
8988
ServiceProvider::CENTREON_BROKER_CONFIGURATION_SERVICE => Domain\Service\BrokerConfigurationService::class,

src/CentreonRemote/Domain/Service/TaskService.php

-8
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131

3232
class TaskService
3333
{
34-
/**
35-
* @var KeyGeneratorInterface
36-
*/
37-
private $gen;
38-
3934
/**
4035
* @var CentreonDBManagerService
4136
*/
@@ -101,15 +96,12 @@ public function getCentreonRestHttp(): \CentreonRestHttp
10196

10297
/**
10398
* TaskService constructor
104-
* @param KeyGeneratorInterface $generator
10599
* @param CentreonDBManagerService $dbManager
106100
*/
107101
public function __construct(
108-
KeyGeneratorInterface $generator,
109102
CentreonDBManagerService $dbManager,
110103
CentcoreCommandService $cmdService
111104
) {
112-
$this->gen = $generator;
113105
$this->dbManager = $dbManager;
114106
$this->cmdService = $cmdService;
115107
}

src/CentreonRemote/ServiceProvider.php

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
use Pimple\Container;
2525
use Pimple\Psr11\ServiceLocator;
26-
use Centreon\Domain\Service\AppKeyGeneratorService;
2726
use Centreon\Infrastructure\Provider\AutoloadServiceProviderInterface;
2827
use Centreon\Infrastructure\Service\CentcoreCommandService;
2928
use CentreonRemote\Application\Webservice;
@@ -85,7 +84,6 @@ function (array $cc, Container $pimple) {
8584

8685
$pimple[static::CENTREON_TASKSERVICE] = function (Container $pimple): TaskService {
8786
$service = new TaskService(
88-
new AppKeyGeneratorService(),
8987
$pimple[\Centreon\ServiceProvider::CENTREON_DB_MANAGER],
9088
new CentcoreCommandService()
9189
);

src/Core/Security/Application/ProviderConfiguration/OpenId/UseCase/UpdateOpenIdConfiguration/UpdateOpenIdConfiguration.php

+9-6
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ private function createAuthorizationRules(array $authorizationRulesFromRequest):
154154
{
155155
$this->info('Creating Authorization Rules');
156156
$accessGroupIds = $this->getAccessGroupIds($authorizationRulesFromRequest);
157+
158+
if (empty($accessGroupIds)) {
159+
return [];
160+
}
161+
157162
$foundAccessGroups = $this->accessGroupRepository->findByIds($accessGroupIds);
158163

159164
$this->logNonExistentAccessGroupsIds($accessGroupIds, $foundAccessGroups);
@@ -241,12 +246,10 @@ private function updateConfiguration(Configuration $configuration): void
241246
}
242247
$this->info('Updating OpenID Configuration');
243248
$this->repository->updateConfiguration($configuration);
244-
if (! empty($configuration->getAuthorizationRules())) {
245-
$this->info('Removing existent Authorization Rules');
246-
$this->repository->deleteAuthorizationRules();
247-
$this->info('Inserting new Authorization Rules');
248-
$this->repository->insertAuthorizationRules($configuration->getAuthorizationRules());
249-
}
249+
$this->info('Removing existent Authorization Rules');
250+
$this->repository->deleteAuthorizationRules();
251+
$this->info('Inserting new Authorization Rules');
252+
$this->repository->insertAuthorizationRules($configuration->getAuthorizationRules());
250253
if (! $isAlreadyInTransaction) {
251254
$this->dataStorageEngine->commitTransaction();
252255
}

src/Core/Security/Application/UseCase/LoginOpenIdSession/LoginOpenIdSession.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ public function __invoke(LoginOpenIdSessionRequest $request, LoginOpenIdSessionP
109109
'contact_location' => (string) $user->getTimezoneId(),
110110
'show_deprecated_pages' => $user->isUsingDeprecatedPages(),
111111
'reach_api' => $user->hasAccessToApiConfiguration() ? 1 : 0,
112-
'reach_api_rt' => $user->hasAccessToApiRealTime() ? 1 : 0
112+
'reach_api_rt' => $user->hasAccessToApiRealTime() ? 1 : 0,
113+
'contact_theme' => $user->getTheme() ?? 'light'
113114
];
114115
$this->provider->setLegacySession(new \Centreon($sessionUserInfos));
115116
$this->startLegacySession($this->provider->getLegacySession());

src/EventSubscriber/WebSSOEventSubscriber.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,11 @@ private function createSession(Contact $user, Request $request): void
252252
'contact_autologin_key' => '',
253253
'contact_admin' => $user->isAdmin() ? '1' : '0',
254254
'default_page' => $user->getDefaultPage(),
255-
'contact_location' => $user->getLocale(),
255+
'contact_location' => (string) $user->getTimezoneId(),
256256
'show_deprecated_pages' => $user->isUsingDeprecatedPages(),
257257
'reach_api' => $user->hasAccessToApiConfiguration() ? 1 : 0,
258-
'reach_api_rt' => $user->hasAccessToApiRealTime() ? 1 : 0
258+
'reach_api_rt' => $user->hasAccessToApiRealTime() ? 1 : 0,
259+
'contact_theme' => $user->getTheme() ?? 'light'
259260
];
260261
$centreonSession = new \Centreon($sessionUserInfos);
261262
$request->getSession()->start();

www/class/centreon-clapi/centreon.Config.Poller.class.php

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
use Centreon\Domain\Entity\Task;
4141
use CentreonRemote\ServiceProvider;
4242
use CentreonRemote\Domain\Service\TaskService;
43-
use Centreon\Domain\Service\AppKeyGeneratorService;
4443
use Centreon\Infrastructure\Service\CentcoreCommandService;
4544
use Centreon\Infrastructure\Service\CentreonDBManagerService;
4645
use Core\Domain\Engine\Model\EngineCommandGenerator;

www/class/centreon-clapi/centreonAPI.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function __construct(
107107
$this->login = htmlentities($user, ENT_QUOTES);
108108
}
109109
if (isset($password)) {
110-
$this->password = htmlentities($password, ENT_QUOTES);
110+
$this->password = filter_var($password, FILTER_SANITIZE_STRING);
111111
}
112112
if (isset($action)) {
113113
$this->action = htmlentities(strtoupper($action), ENT_QUOTES);

www/class/centreon-clapi/centreonHostGroup.class.php

+15-10
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public function getparam($parameters = null)
174174
$listParam = explode('|', $params[1]);
175175
$exportedFields = [];
176176
$resultString = "";
177+
$paramString = "";
177178
foreach ($listParam as $paramSearch) {
178179
if (!$paramString) {
179180
$paramString = $paramSearch;
@@ -257,20 +258,24 @@ public function initUpdateParameters($parameters = null)
257258
public function getIdIcon($path)
258259
{
259260
$iconData = explode('/', $path);
260-
$query = 'SELECT dir_id FROM view_img_dir WHERE dir_name = "' . $iconData[0] . '"';
261-
$res = $this->db->query($query);
262-
$row = $res->fetch();
261+
$dirStatement = $this->db->prepare("SELECT dir_id FROM view_img_dir WHERE dir_name = :IconData");
262+
$dirStatement->bindValue(':IconData', $iconData[0], \PDO::PARAM_STR);
263+
$dirStatement->execute();
264+
$row = $dirStatement->fetch();
263265
$dirId = $row['dir_id'];
264266

265-
$query = 'SELECT img_id FROM view_img WHERE img_path = "' . $iconData[1] . '"';
266-
$res = $this->db->query($query);
267-
$row = $res->fetch();
267+
$imgStatement = $this->db->prepare("SELECT img_id FROM view_img WHERE img_path = :iconData");
268+
$imgStatement->bindValue(':iconData', $iconData[1], \PDO::PARAM_STR);
269+
$imgStatement->execute();
270+
$row = $imgStatement->fetch();
268271
$iconId = $row['img_id'];
269272

270-
$query = 'SELECT vidr_id FROM view_img_dir_relation ' .
271-
'WHERE dir_dir_parent_id = ' . $dirId . ' AND img_img_id = ' . $iconId;
272-
$res = $this->db->query($query);
273-
$row = $res->fetch();
273+
$vidrStatement = $this->db->prepare("SELECT vidr_id FROM view_img_dir_relation " .
274+
"WHERE dir_dir_parent_id = :dirId AND img_img_id = :iconId");
275+
$vidrStatement->bindValue(':dirId', (int) $dirId, \PDO::PARAM_INT);
276+
$vidrStatement->bindValue(':iconId', (int) $iconId, \PDO::PARAM_INT);
277+
$vidrStatement->execute();
278+
$row = $vidrStatement->fetch();
274279
return $row['vidr_id'];
275280
}
276281

www/class/centreon-clapi/centreonLDAP.class.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,12 @@ public function showserver($arName = null)
184184
}
185185
$sql = "SELECT ldap_host_id, host_address, host_port, use_ssl, use_tls, host_order
186186
FROM auth_ressource_host
187-
WHERE auth_ressource_id = " . $arId . "
187+
WHERE auth_ressource_id = :auth_ressource_id
188188
ORDER BY host_order";
189-
$res = $this->db->query($sql);
190-
$row = $res->fetchAll();
189+
$statement = $this->db->prepare($sql);
190+
$statement->bindValue(':auth_ressource_id', (int) $arId, \PDO::PARAM_INT);
191+
$statement->execute();
192+
$row = $statement->fetchAll(\PDO::FETCH_ASSOC);
191193
echo "id;address;port;ssl;tls;order\n";
192194
foreach ($row as $srv) {
193195
echo $srv['ldap_host_id'] . $this->delim .

www/class/centreon-clapi/centreonService.class.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1584,12 +1584,12 @@ public function getCustomMacroInDb($serviceId = null, $template = null)
15841584
$arr = array();
15851585
$i = 0;
15861586
if ($serviceId) {
1587-
$res = $this->db->query("SELECT svc_macro_name, svc_macro_value, is_password, description
1588-
FROM on_demand_macro_service
1589-
WHERE svc_svc_id = " .
1590-
$serviceId . "
1591-
ORDER BY macro_order ASC");
1592-
while ($row = $res->fetch()) {
1587+
$statement = $this->db->prepare("SELECT svc_macro_name, svc_macro_value, is_password, description " .
1588+
"FROM on_demand_macro_service " .
1589+
"WHERE svc_svc_id = :serviceId ORDER BY macro_order ASC");
1590+
$statement->bindValue(':serviceId', (int) $serviceId, \PDO::PARAM_INT);
1591+
$statement->execute();
1592+
while ($row = $statement->fetch()) {
15931593
if (preg_match('/\$_SERVICE(.*)\$$/', $row['svc_macro_name'], $matches)) {
15941594
$arr[$i]['svc_macro_name'] = $matches[1];
15951595
$arr[$i]['svc_macro_value'] = $row['svc_macro_value'];

www/class/centreon-knowledge/procedures.class.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,15 @@ public function getMyHostMultipleTemplateModels($host_id = null)
139139
"WHERE host_host_id = '" . $host_id . "' " .
140140
"ORDER BY `order`"
141141
);
142+
$statement = $this->centreon_DB->prepare(
143+
"SELECT host_name " .
144+
"FROM host " .
145+
"WHERE host_id = :host_id LIMIT 1"
146+
);
142147
while ($row = $dbResult->fetch()) {
143-
$dbResult2 = $this->centreon_DB->query(
144-
"SELECT host_name " .
145-
"FROM host " .
146-
"WHERE host_id = '" . $row['host_tpl_id'] . "' LIMIT 1"
147-
);
148-
$hTpl = $dbResult2->fetch();
148+
$statement->bindValue(':host_id', $row['host_tpl_id'], \PDO::PARAM_INT);
149+
$statement->execute();
150+
$hTpl = $statement->fetch(\PDO::FETCH_ASSOC);
149151
$tplArr[$row['host_tpl_id']] = html_entity_decode($hTpl["host_name"], ENT_QUOTES);
150152
}
151153
unset($row);

0 commit comments

Comments
 (0)