summaryrefslogtreecommitdiff
path: root/README
blob: 6229e0f97bd23e1c0eb4f29a494f822c058a29e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
=======================================================================
                Net::LDAPapi Module v3.0.5 for Perl5
		by Quanah Gibson-Mount @ Symas, Inc.
	based on version 2.00 by Quanah Gibson-Mount @ Stanford University
	based on version 1.50 by Howard Chu @ Symas Corporation
	based on version 1.43 by Clayton Donley, <donley@wwa.com>
=======================================================================

COPYRIGHT
=========
   Copyright (c) 2017 Quanah Gibson-Mount. All rights reserved
   Copyright (c) 2007 Quanah Gibson-Mount. All rights reserved
   Copyright (c) 2007 Board of Trustees, Leland Stanford Jr. University
   Copyright (c) 2003 Howard Chu. All rights reserved.
   Copyright (c) 1998 Clayton Donley. All rights reserved.
   This program is free software; you can redistribute it and/or
   modify it under the same terms as Perl itself.


INTRODUCTION
============

This module acts as a Perl5 interface to the LDAP C Development Kits from
OpenLDAP and Mozilla.  The module itself is written completely
in C.  Full documentation is included, as are commented example scripts. 
The current version supports the LDAPv3 API as implemented in OpenLDAP.

REQUIREMENTS
============

This module requires Perl5, a C compiler, and the LDAP libraries and include
files from one of the following: 

OpenLDAP C SDK (support added by Symas):
    http://www.openldap.org
Mozilla LDAP C SDK
    http://wiki.mozilla.org/LDAP_C_SDK

A C Compiler is not required for the NT version if you download Perl5
and module binaries and the Mozilla SDK (you must copy the DLL into your
system directory).


PLATFORMS SUPPORTED
===================

This version should be easily compiled on various platforms. It has been tested
extensively under Solaris and Linux.

As of 3.00, the module has not been tested on Windows.

Please let me know if you compile it successfully on a new platform or have
any problems. For problems, please include the compilation errors. 

Support for the Mozilla SDK has not been tested with the v3 rewrites.  Testing
welcomed.


NEW PERL-OO INTERFACE
=====================

As of version 1.40, a new Perl-OO layer has been added to allow more
object oriented access into the API.  All of the original commands are
unchanged, but are no longer documented.  You are encouraged to use the
new OO style routines, which are documented in the man-page.

Version 1.42 and above support passing named arguments to all methods.


UNIX INSTALLATION
=================

   After extracting the archive, simply type the following:

      $ perl5 Makefile.PL
      $ make

   Edit the file test.pl to contain your LDAP server, BASEDN, and filter
string.  Next type:

      $ make test

   It should complete all of its tests with no problems.  To install the
module you will likely need to become root and type:

      # make install

   That's it.  You can now 'use Net::LDAPapi' and make LDAP calls within your
PERL5 scripts with ease.

NT SOURCE INSTALLATION
======================

   I use Microsoft Visual C++ 5.0.  I am not certain what procedures you will
need to follow with other compilers.

   C:\> perl Makefile.PL

   Answer the questions appropriately.  Supply the path to PERL.EXE and the
Mozilla library and include files from their SDK.

   C:\> nmake

   The module will now be built.

   c:\> edit test.pl

   Change the LDAP server name and other attributes as necessary.

   C:\> nmake test

   If it passes most of the tests, it probably works, so you'll want to
install.  For this, just type:

   C:\> nmake install

   You can now do a 'use Net::LDAPapi' from your NT Perl modules.  You will
also want be be sure to copy the nsldap32v11.dll file into your system32
folder.

 
NT BINARY INSTALLATION
======================

   First, obtain Perl 5.004 binaries for Windows NT.  You can get it at the
following URL:  http://www.perl.com/CPAN-local/authors/id/GSAR/.  Simply get
one of the files starting with 'perl5.004'.

   You will also need the Mozilla LDAP SDK mentioned previously.  Copy the
nsldap32v11.dll file from that archive into your system32 folder.

   Finally, unzip the archive into the C:\ directory if you installed
PERL in C:\PERL.  Otherwise, extract to the parent directory of your PERL
installation directory.


EXAMPLES
========

   There exists six examples in the 'examples' directory.  The current
examples are:

      o ldapwalk.pl - This script demonstrates the use of Asynchronous LDAP
         calls to return all the attributes and values for entries matching
         a filter specified on the command line.  Simply change the variables
         at the start of the file to match your environment.

      o ldapwalk2.pl - This is the same as ldapwalk.pl, only it shows how to
         replace the portion that retrieves results and packages them in
         the hash of hashes with the new get_all_entries function.

      o testwrite.pl - This script demonstrates using synchronous Add, Modify,
         and Delete calls to manage an LDAP server.  You need update access
         to an LDAP server to run this example.  Once again, simply change
         the variables at the top of the file.

      o www-ldap.pl - This script uses both this module and the CGI.pm
         module available on the Internet (and included in 5.004).  It
         allows users to authenticate and modify their own information.
         You can easily customize this program, or learn from it and
         write your own CGIs.  The BIND and WEB_AUTHENTICATE subroutines
         would be especially useful in incorporating LDAP authentication
         into your own CGI scripts, even if the script has nothing to
         do with LDAP otherwise.

      o web500.pl - This script is a complete Web->LDAP gateway.  It uses
         CGI.pm and this module.  It can be easily customized, supports
         searching, modifications, and even things like jpegphoto uploads
         and displaying.  The original design used frames, but switched
         to a WebPH style interface for the search part on the advice of
         Douglas Gray Stephens.

      o updatepw.pl - Updates a password entry for a user from Unix into
         the LDAP server.  You'll likely have to tinker with this program
         to get it to do exactly what you want, but it exists as an idea
         as to how you can do this.

      o ldap_mod_attr.pl - Matches a filter or UID and makes specified changes
         to each entry.  Contributed by Andrew J Cosgriff.

   In addition, the test.pl program in the top level directory shows some
of the basic synchronous search functionality.


LDAP C API SUPPORT
==================

   This module supports direct perl access to all C API calls with the
exception of filter generation calls (since you can do this better in Perl
anyway).

   While direct access is available, it is suggested that you use the
Perl-OO style interface if you have never used the C API.


FEEDBACK
========
   Any feedback should be directed to quanah.gibsonmount@gmail.com


BUGS
====

   The non-OO stuff should work well.  Please let me know if I've introduced
any bugs in the OO stuff or the changed examples.

   Please report bugs at github - https://github.com/quanah/net-ldapapi/issues/

--
Clayton Donley
Rolling Meadows, IL, USA
email: donley@wwa.com
web:   http://www.wwa.com/~donley
CPAN:  /authors/id/CDONLEY

Howard Chu
Chief Architect, Symas Corporation	http://www.symas.com
Core Team, OpenLDAP Project		http://www.openldap.org

Quanah Gibson-Mount
email: quanah.gibsonmount@gmail.com
CPAN: /by-authors/id/M/MI/MISHIKAL
Platform Architect
Synacor, Inc				http://www.zimbra.com http://synacor.com/
Core Team, OpenLDAP Project		http://www.openldap.org