From 31fa9d1491199776270611d736658a5e49857a64 Mon Sep 17 00:00:00 2001
From: Andre Carregal
You can also reach other Kepler developers and users on the Kepler Project +mailing list.
+- $Id: index.html,v 1.29 2006-03-22 17:12:16 carregal Exp $ -
+ +$Id: index.html,v 1.30 2006-03-25 15:51:04 carregal Exp $
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation @@ -104,10 +104,9 @@ SOFTWARE.
- $Id: license.html,v 1.7 2005-05-23 18:27:11 carregal Exp $ -
+ +$Id: license.html,v 1.8 2006-03-25 15:51:04 carregal Exp $
LuaLDAP is a simple interface from Lua to an LDAP client (in +
LuaLDAP is a simple interface from Lua to an LDAP client, in fact it is a bind to OpenLDAP -client).
+client.LuaLDAP defines one single global variable: a table called
lualdap
. This table holds the functions used to create an
@@ -70,17 +70,12 @@ tables; attributes are its fields. The attribute values can be
strings or tables of strings (used to represent multiple
values).
LuaLDAP is a bind to the OpenLDAP library, therefore it +
LuaLDAP is a bind to the +OpenLDAP library and it depends on a previous installation of this library. You can -download OpenLDAP from the OpenLDAP download -page.
- -LuaLDAP source consists in a single C source file.
-The distribution provides a Makefile
prepared to
-compile the library and install it. The file config
should
-be edited to suit the needs of the aimed platform.
LUA_CPATH
.
-Windows users can use the pre-compiled versions of LuaLDAP +
Windows users can use the binary versions of LuaLDAP
(lualdap.dll
) and OpenLDAP
(libsasl.dll
) available at
LuaForge.
Many LDAP operations manage sets of attributes and values. -LuaLDAP provides a uniform way of representing them: using Lua -tables. A table of attributes is indexed by the name of the -attribute and its value can be a string (be careful: it can also be -a "binary string") or a list/table of values indexed by numbers -from 1 to n. Some operations have different approaches -that will be explained when necessary.
+LuaLDAP provides a uniform way of representing them by using Lua +tables. The table attributes can be Lua string, a binary string (a string of +bits), or table of n values indexed from 1 to n. +Some operations have different approaches that will be explained as necessary. -Follows a small example:
+Here is a simple example:
entry = { @@ -119,7 +112,7 @@ entry = { }-Attribute names cannot contain zeroes (
'\0'
)
+Attribute names cannot contain the '\0'
character.
A more precise definition can be found on the LDAP documentation. A list of some of these files can be found in -section Related documentation.
+Related documentation section.password
. The optional argument usetls
is a
Boolean flag indicating if Transport Layer Security (TLS) should be
used.nil
followed by an error
- string.
+ Returns a connection object if the operation was successful. In case of
+ error it returns nil
followed by an error string.
A connection object offers methods which implement LDAP -operations. Almost all of them need a distinguished -name to identify the entry on which the operation will be -executed.
+operations. Almost all of them need a +distinguished name to identify the entry on which the +operation will be executed.These methods execute asynchronous operations and return a
-function that should be called to obtain the result(s). These
-functions will return true
indicating success of the
-operation; the only exception is the function compare
+function that should be called to obtain the results. The called
+functions will return true
indicating the success of the
+operation. The only exception is the compare
function
which can return either true
or false
-(which is the result of the comparison) on a successful operation.
There are two types of errors: API errors, such as
wrong parameters, absent connection etc.; and LDAP errors,
-such as mal-formed DN, unknown attribute etc. API errors will raise
+such as malformed DN, unknown attribute etc. API errors will raise
a Lua error, while LDAP errors will be reported by the
-function/method returning nil
followed by the error
+function/method returning nil
plus the error
message provided by the OpenLDAP client.
A connection object can be created by calling the
conn:compare (distinguished_name, attribute,
value)
conn:delete (distinguished_name)
conn:modify (distinguished_name,
table_of_operations*)
1
indicating the operation to be
performed. The valid operations are:
@@ -209,13 +202,12 @@ message provided by the OpenLDAP client.
'-'
to delete the values of the attributes'='
to replace the values of the attributesconn:rename (distinguished_name, new_relative_dn,
new_parent)
conn:search (table_of_search_parameters)
Below is a small sample code displaying the basic use of the -library.
+here is a some sample code that demonstrate the basic use of the library.
require "lualdap" @@ -331,7 +322,7 @@ ld:delete ("mydn=newuser,ou=people,dc=ldp,dc=world")() -- cgit v1.2.3-59-g8ed1b