comparison lisp/ldap.el @ 298:70ad99077275 r21-0b47

Import from CVS: tag r21-0b47
author cvs
date Mon, 13 Aug 2007 10:39:40 +0200
parents c42ec1d1cded
children c6de09ad3017
comparison
equal deleted inserted replaced
297:deca3c1083ac 298:70ad99077275
3 ;; Copyright (C) 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
4 4
5 ;; Author: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> 5 ;; Author: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch>
6 ;; Maintainer: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch> 6 ;; Maintainer: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch>
7 ;; Created: Jan 1998 7 ;; Created: Jan 1998
8 ;; Version: $Revision: 1.5 $ 8 ;; Version: $Revision: 1.7 $
9 ;; Keywords: help comm 9 ;; Keywords: help comm
10 10
11 ;; This file is part of XEmacs 11 ;; This file is part of XEmacs
12 12
13 ;; XEmacs is free software; you can redistribute it and/or modify it 13 ;; XEmacs is free software; you can redistribute it and/or modify it
39 (require 'ldap)) 39 (require 'ldap))
40 40
41 (defvar ldap-default-host nil 41 (defvar ldap-default-host nil
42 "*Default LDAP server.") 42 "*Default LDAP server.")
43 43
44 (defvar ldap-host-parameters-plist nil 44 (defvar ldap-host-parameters-alist nil
45 "*A property list of per host options for LDAP transactions 45 "*An alist of per host options for LDAP transactions
46 The list elements look like (HOST PROP1 VAL1 PROP2 VAL2 ...) 46 The list elements look like (HOST PROP1 VAL1 PROP2 VAL2 ...)
47 HOST is the name of an LDAP server. PROPn and VALn are property/value pairs 47 HOST is the name of an LDAP server. PROPn and VALn are property/value pairs
48 describing parameters for the server. Valid properties: 48 describing parameters for the server. Valid properties:
49 `binddn' is the distinguished name of the user to bind as 49 `binddn' is the distinguished name of the user to bind as
50 (in RFC 1779 syntax). 50 (in RFC 1779 syntax).
65 ATTRIBUTES is the specific attributes to retrieve, nil means 65 ATTRIBUTES is the specific attributes to retrieve, nil means
66 retrieve all 66 retrieve all
67 ATTRSONLY if non nil retrieves the attributes only without 67 ATTRSONLY if non nil retrieves the attributes only without
68 the associated values. 68 the associated values.
69 Additional search parameters can be specified through 69 Additional search parameters can be specified through
70 `ldap-host-parameters-plist' which see." 70 `ldap-host-parameters-alist' which see."
71 (interactive "sFilter:") 71 (interactive "sFilter:")
72 (let (host-plist res ldap) 72 (let (host-plist res ldap)
73 (if (null host) 73 (if (null host)
74 (setq host ldap-default-host)) 74 (setq host ldap-default-host))
75 (if (null host) 75 (if (null host)
76 (error "No LDAP host specified")) 76 (error "No LDAP host specified"))
77 (setq host-plist 77 (setq host-plist
78 (cdr (assoc host ldap-host-parameters-plist))) 78 (cdr (assoc host ldap-host-parameters-alist)))
79 (message "Opening LDAP connection to %s..." host) 79 (message "Opening LDAP connection to %s..." host)
80 (setq ldap (ldap-open host host-plist)) 80 (setq ldap (ldap-open host host-plist))
81 (message "Searching with LDAP on %s..." host) 81 (message "Searching with LDAP on %s..." host)
82 (setq res (ldap-search-internal ldap filter 82 (setq res (ldap-search-internal ldap filter
83 (plist-get host-plist 'base) 83 (plist-get host-plist 'base)