1 (in-package :net.quadium.ldap
)
3 (defun convert-search-filter (filter)
4 "Returns a filter string created from the FILTER sexp.
7 (convert-search-filter '(and (not (or (= \"objectClass\" \"computer\")
8 (= \"objectClass\" \"group\")))
9 (= \"location\" \"millenia*\")))
10 => \"(&(!(|(objectClass=computer)(objectClass=group)))(location=millenia*))\""
13 ((member (car filter
) '(= ~
= <= >=))
14 (destructuring-bind (filter-type attribute-type attribute-value
)
16 (format nil
"(~A~A~A)"
17 (ldap-escape attribute-type
) filter-type
(ldap-escape attribute-value
))))
18 ((member (car filter
) '(and or
))
19 (format nil
"(~A~{~A~})"
23 (mapcar 'convert-search-filter
(cdr filter
))))
24 ((eq (car filter
) 'not
)
25 (format nil
"(!~A)" (convert-search-filter (cadr filter
))))))