Mercurial > hg > xemacs-beta
comparison lisp/ldap.el @ 259:11cf20601dec r20-5b28
Import from CVS: tag r20-5b28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:23:02 +0200 |
parents | |
children | 405dd6d1825b |
comparison
equal
deleted
inserted
replaced
258:58424f6abf56 | 259:11cf20601dec |
---|---|
1 ;;; ldap.el --- LDAP support for Emacs | |
2 | |
3 ;; Copyright (C) 1997 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> | |
6 ;; Maintainer: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> | |
7 ;; Created: Jan 1998 | |
8 ;; Version: $Revision: 1.1 $ | |
9 ;; Keywords: help comm | |
10 | |
11 ;; This file is part of XEmacs | |
12 | |
13 ;; XEmacs is free software; you can redistribute it and/or modify it | |
14 ;; under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; XEmacs is distributed in the hope that it will be useful, but | |
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 ;; General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
24 ;; along with XEmacs; see the file COPYING. If not, write to | |
25 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
26 ;; Boston, MA 02111-1307, USA. | |
27 | |
28 ;;; Commentary: | |
29 ;; This file provides mid-level and user-level functions to access directory | |
30 ;; servers using the LDAP protocol (RFC 1777). | |
31 | |
32 ;;; Installation: | |
33 ;; LDAP support must have been built into XEmacs. | |
34 | |
35 | |
36 ;;; Code: | |
37 | |
38 (require 'ldap-internal) | |
39 | |
40 (defvar ldap-host-parameters-alist nil | |
41 "An alist describing per host options to use for LDAP transactions | |
42 The list has the form ((HOST OPTION OPTION ...) (HOST OPTION OPTION ...)) | |
43 HOST is the name of an LDAP server. OPTIONs are cons cells describing | |
44 parameters for the server. Valid options are: | |
45 (binddn . BINDDN) | |
46 (passwd . PASSWD) | |
47 (auth . AUTH) | |
48 (base . BASE) | |
49 (scope . SCOPE) | |
50 (deref . DEREF) | |
51 (timelimit . TL) | |
52 (sizelimit . SL)) | |
53 BINDDN is the distinguished name of the user to bind as (in RFC 1779 syntax). | |
54 PASSWD is the password to use for simple authentication. | |
55 AUTH is the authentication method to use, possible values are: | |
56 `simple', `krbv41' and `krbv42'. | |
57 BASE is the base for the search as described in RFC 1779. | |
58 SCOPE is one of the three symbols `subtree', `base' or `onelevel'. | |
59 DEREF is one of the symbols `never', `always', `search' or `find'. | |
60 TL is the timeout limit for the connection in seconds. | |
61 SL is the maximum number of matches to return." ) | |
62 | |
63 | |
64 (defun ldap-search (filter &optional host attributes attrsonly) | |
65 "Perform an LDAP search. | |
66 FILTER is the search filter in RFC1558 syntax | |
67 HOST is the LDAP host on which to perform the search | |
68 ATTRIBUTES is the specific attributes to retrieve, nil means | |
69 retrieve all | |
70 ATTRSONLY if non nil retrieves the attributes only without | |
71 the associated values. | |
72 Additional search parameters can be specified through | |
73 `ldap-host-parameters-alist' which see." | |
74 (interactive "sFilter:") | |
75 (let (host-alist) | |
76 (if (null host) | |
77 (setq host ldap-default-host)) | |
78 (if (null host) | |
79 (error "No LDAP host specified")) | |
80 (setq host-alist | |
81 (assoc host ldap-host-parameters-alist)) | |
82 (ldap-search-internal (append | |
83 (list 'host host | |
84 'filter filter | |
85 'attributes attributes | |
86 'attrsonly attrsonly) | |
87 (alist-to-plist host-alist))) | |
88 )) | |
89 | |
90 | |
91 | |
92 (provide 'ldap) | |
93 | |
94 ;;; ldap.el ends here |