* 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/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
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)
(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)))))
;;}}}