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

Commit

Permalink
FIX: Sanitize and bind LDAP CLAPI listing (#11764)
Browse files Browse the repository at this point in the history
* sanitize and bind clapi LDAP listing

* removing unecessary code
  • Loading branch information
hyahiaoui-ext authored Sep 19, 2022
1 parent 1e07242 commit 72732a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions www/class/centreon-clapi/centreonLDAP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ public function showserver($arName = null)
}
$sql = "SELECT ldap_host_id, host_address, host_port, use_ssl, use_tls, host_order
FROM auth_ressource_host
WHERE auth_ressource_id = " . $arId . "
WHERE auth_ressource_id = :auth_ressource_id
ORDER BY host_order";
$res = $this->db->query($sql);
$row = $res->fetchAll();
$statement = $this->db->prepare($sql);
$statement->bindValue(':auth_ressource_id', (int) $arId, \PDO::PARAM_INT);
$statement->execute();
$row = $statement->fetchAll(\PDO::FETCH_ASSOC);
echo "id;address;port;ssl;tls;order\n";
foreach ($row as $srv) {
echo $srv['ldap_host_id'] . $this->delim .
Expand Down

0 comments on commit 72732a8

Please sign in to comment.