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

FIX: Sanitize and bind LDAP CLAPI listing 21.10.x #11797

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
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