Verified Commit 9124ca2c authored by dockx thibault's avatar dockx thibault
Browse files

:ambulance: (setup) - fixes ldap p2

backup and some fixes in ldap.
No related merge requests found
Showing with 9 additions and 3 deletions
+9 -3
......@@ -604,10 +604,17 @@ class LDAP
*
* \param $srp srp
*/
function count ($srp)
function count($srp)
{
if ($this->hascon) {
if ($this->hasres[$srp] && !is_bool($this->hasres[$srp])) {
if (!empty($this->hasres[$srp])) {
// Ensure $this->sr[$srp] is a valid LDAP result
if ($this->sr[$srp] === false) {
$this->error = "LDAP search returned no results";
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'count()');
return 0; // Return 0 as there are no entries
}
$rv = @ldap_count_entries($this->cid, $this->sr[$srp]);
$this->error = @ldap_error($this->cid);
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'count()');
......@@ -624,7 +631,6 @@ class LDAP
}
}
/*!
* \brief Remove
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment