alecpl
2009-09-10 71047326faf2feaac3f4017e71dad8d2fa5b2e42
program/include/rcube_ldap.php
@@ -57,6 +57,10 @@
      if (preg_match('/^(.+)_field$/', $prop, $matches))
        $this->fieldmap[$matches[1]] = $this->_attr_name(strtolower($value));
    // make sure 'required_fields' is an array
    if (!is_array($this->prop['required_fields']))
      $this->prop['required_fields'] = (array) $this->prop['required_fields'];
    foreach ($this->prop['required_fields'] as $key => $val)
      $this->prop['required_fields'][$key] = $this->_attr_name(strtolower($val));
@@ -384,7 +388,7 @@
    $res = null;
    if ($this->conn && $dn)
    {
      $this->ldap_result = ldap_read($this->conn, base64_decode($dn), '(objectclass=*)', array_values($this->fieldmap));
      $this->ldap_result = @ldap_read($this->conn, base64_decode($dn), '(objectclass=*)', array_values($this->fieldmap));
      $entry = @ldap_first_entry($this->conn, $this->ldap_result);
      if ($entry && ($rec = ldap_get_attributes($this->conn, $entry)))
@@ -546,7 +550,7 @@
      } // end if
    } // end foreach
    return true;
    return count($dns);
  }
@@ -561,7 +565,7 @@
    {
      $filter = $this->filter ? $this->filter : '(objectclass=*)';
      $function = $this->prop['scope'] == 'sub' ? 'ldap_search' : ($this->prop['scope'] == 'base' ? 'ldap_read' : 'ldap_list');
      $this->ldap_result = $function($this->conn, $this->prop['base_dn'], $filter, array_values($this->fieldmap), 0, 0);
      $this->ldap_result = @$function($this->conn, $this->prop['base_dn'], $filter, array_values($this->fieldmap), 0, 0);
      return true;
    }
    else