Commit 1e1f5b9c authored by Thomas Fitzsimmons's avatar Thomas Fitzsimmons

Append LDAP wildcard character to end of search string

* net/eudc.el (eudc-format-query): Preserve the
eudc-inline-query-format ordering of attributes in the returned
list.
* net/eudcb-ldap.el (eudc-ldap-format-query-as-rfc1558): Append
the LDAP wildcard character to the last attribute value.
parent 6a3a3b0e
2014-11-13 Thomas Fitzsimmons <fitzsim@fitzsim.org>
* net/eudc.el (eudc-format-query): Preserve the
eudc-inline-query-format ordering of attributes in the returned
list.
* net/eudcb-ldap.el (eudc-ldap-format-query-as-rfc1558): Append
the LDAP wildcard character to the last attribute value.
2014-11-13 Thomas Fitzsimmons <fitzsim@fitzsim.org>
* net/eudcb-ldap.el (eudc-ldap-cleanup-record-simple): Downcase
......
......@@ -763,7 +763,6 @@ otherwise a list of symbols is returned."
format (cdr format)))
;; If the same attribute appears more than once, merge
;; the corresponding values
(setq query-alist (nreverse query-alist))
(while query-alist
(setq key (eudc-caar query-alist)
val (eudc-cdar query-alist)
......
......@@ -174,14 +174,16 @@ attribute names are returned. Default to `person'"
(defun eudc-ldap-format-query-as-rfc1558 (query)
"Format the EUDC QUERY list as a RFC1558 LDAP search filter."
(format "(&%s)"
(apply 'concat
(mapcar (lambda (item)
(format "(%s=%s)"
(car item)
(eudc-ldap-escape-query-special-chars (cdr item))))
query))))
(let ((formatter (lambda (item &optional wildcard)
(format "(%s=%s)"
(car item)
(concat
(eudc-ldap-escape-query-special-chars
(cdr item)) (if wildcard "*" ""))))))
(format "(&%s)"
(concat
(mapconcat formatter (butlast query) "")
(funcall formatter (car (last query)) t)))))
;;}}}
......
Markdown is supported
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