Function: eudc-ldap-simple-query-internal

eudc-ldap-simple-query-internal is a byte-compiled function defined in eudcb-ldap.el.gz.

Signature

(eudc-ldap-simple-query-internal QUERY &optional RETURN-ATTRS)

Documentation

Query the LDAP server with QUERY.

QUERY is a list of cons cells (ATTR . VALUE) where ATTRs should be valid LDAP attribute names. RETURN-ATTRS is a list of attributes to return, defaulting to eudc-default-return-attributes.

Source Code

;; Defined in /usr/src/emacs/lisp/net/eudcb-ldap.el.gz
(defun eudc-ldap-simple-query-internal (query &optional return-attrs)
  "Query the LDAP server with QUERY.
QUERY is a list of cons cells (ATTR . VALUE) where ATTRs should be valid
LDAP attribute names.
RETURN-ATTRS is a list of attributes to return, defaulting to
`eudc-default-return-attributes'."
  (let ((result (ldap-search (eudc-ldap-format-query-as-rfc1558 query)
			     eudc-server
			     (if (listp return-attrs)
				 (mapcar #'symbol-name return-attrs))))
	final-result)
    (setq result (mapcar #'eudc-ldap-cleanup-record-filtering-addresses result))

    (if (and eudc-strict-return-matches
	     return-attrs
	     (not (eq 'all return-attrs)))
	(setq result (eudc-filter-partial-records result return-attrs)))
    ;; Apply eudc-duplicate-attribute-handling-method
    (if (not (eq 'list eudc-duplicate-attribute-handling-method))
	(mapc
         (lambda (record)
           (setq final-result
                 (append (eudc-filter-duplicate-attributes record)
                         final-result)))
	 result))
    final-result))