Platforms to show: All Mac Windows Linux Cross-Platform

Back to LDAPMBS class.

LDAPMBS.Add(distinguishedName as string, attrs() as LDAPModMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds attributes.
Example
// add like this

dim m1 as new LDAPModMBS
dim m2 as new LDAPModMBS

m1.Operation = m1.kOperationAdd
m1.Type = "sn"
m1.addValue "yyy"

m2.Operation = m1.kOperationAdd
m2.Type = "cn"
m2.addValue "xxx"

dim attr() as LDAPModMBS
attr.Append m1
attr.Append m2

l.Add("test", attr)

The Add function initiates a synchronous add operation that adds an entry to a tree. The parent of the entry being added must already exist or the parent must be empty (equal to the root distinguished name) for an add operation to succeed.

Before calling Add, you must create an entry by specifying its attributes in LDAPModMBS objects. Set the Operator member of each structure to kOperationAdd, and set the Type and Value members as appropriate for your entry.

LDAPMBS.Bind(Who as String, Cred as String, AuthMethod as Integer, Domain as String = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Binds to a server with given credentials and authorization method.

Synchronously authenticates a client to the LDAP server.

Added domain parameter in plugin version 17.1, Windows only.

LDAPMBS.Connect(TimeOutSeconds as Double = 1.0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Connects to server.

On Mac does nothing.

LDAPMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ❌ No ✅ Yes ✅ Yes All
Default constructor.

Creates a new connection without connecting.

See also:

LDAPMBS.Constructor(IP as string, Port as Integer, Open as Boolean = false, Secure as Boolean = false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a connection to a LDAP server.
Example
// connect with SSL
dim ldap as LDAPMBS

#if TargetWin32 then
ldap = new LDAPMBS("192.168.1.123", 636, false, true)
#else
ldap = new LDAPMBS("ldaps://192.168.1.123")
#endif

If open is true, we connect directly to server.
Secure: For Windows Vista and newer. Set to true for a secure connection with SSL. (only for open=false)

For connecting via SSL, please use on Mac OS X the Constructor taking the URL and specify ldaps protocol. For Windows use this constructor with secure parameter set to true.

Changed with 16.0 to work on Mac with secure = true. For Windows we switch to Open = false if secure is true.

See also:

LDAPMBS.Constructor(URL as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a connection to a LDAP server.
Example
// connect with SSL
dim ldap as LDAPMBS

#if TargetWin32 then
ldap = new LDAPMBS("192.168.1.123", 636, false, true)
#else
ldap = new LDAPMBS("ldaps://192.168.1.123")
#endif

Added Windows support in 16.0 plugins.

See also:

LDAPMBS.Delete(distinguishedName as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Deletes an entry.

LDAPMBS.Modify(distinguishedName as string, attrs() as LDAPModMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Modifies an entry.

Please pass one LDAPModMBS for each attribute to change.

The Modify function initiates a synchronous operation to modify an existing entry. If values are being added to or replaced in the entry, the function creates the attribute, if necessary. If values are being deleted, the function removes the attribute if no values remain. All modifications are performed in the order in which they are listed.

When connecting to an LDAP 2 server, the application must perform a bind operation (by calling one of the Bind or SimpleBind routines) before attempting any other operations.

LDAPMBS.Rename(distinguishedName as string, NewRDN as String, NewParent as String, DeleteOldRdn as Boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Renames an item and can move it to other parent.

See also:

LDAPMBS.Search(distinguishedName as string, Scope as Integer, Filter as String, Attrs() as String = nil, AttributesOnly as boolean = false, timeout as Double = 1.0, SizeLimit as Integer = 0) as Dictionary()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Search for something.
Example
// Get a handle to an LDAP connection and set any session preferences.
dim l as new LDAPMBS("localhost", 389)

// Use the ProtocolVersion session preference to specify that the client is an LDAPv3 client.
l.ProtocolVersion = 3
if l.Lasterror <> 0 then
dim error as string = l.ErrorString(l.Lasterror)
Break
end if

// Bind to the server.
// In this example, the client binds anonymously to the server
// (no DN or credentials are specified).

l.SimpleBind("", "")
if l.Lasterror <> 0 then
dim error as string = l.ErrorString(l.Lasterror)
Break
end if

const BASEDN = "dc=example,dc=com"
const SCOPE = l.kScopeSubtree
const FILTER = "(sn=Jensen)"

dim results() as Dictionary = l.Search(BASEDN, SCOPE, FILTER)

for each dic as Dictionary in results
Break // look in debugger
next

The plugin will return result as array of Dictionaries, one for each item. Dictionary contains attributes with their values. A special entry has key = nil and as value the distinguish name of the item.

LDAPMBS.SimpleBind(Who as String, Cred as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Simple bind call.
Example
// Get a handle to an LDAP connection and set any session preferences.
dim l as new LDAPMBS("localhost", 389)

// Use the ProtocolVersion session preference to specify that the client is an LDAPv3 client.
l.ProtocolVersion = 3
if l.Lasterror <> 0 then
dim error as string = l.ErrorString(l.Lasterror)
Break
end if

// Bind to the server.
// In this example, the client binds anonymously to the server
// (no DN or credentials are specified).

l.SimpleBind("", "")
if l.Lasterror <> 0 then
dim error as string = l.ErrorString(l.Lasterror)
Break
end if

const BASEDN = "dc=example,dc=com"
const SCOPE = l.kScopeSubtree
const FILTER = "(sn=Jensen)"

dim results() as Dictionary = l.Search(BASEDN, SCOPE, FILTER)

for each dic as Dictionary in results
Break // look in debugger
next

LDAPMBS.StartTLS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LDAP MBS Network Plugin 19.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sends a StartTLS request to a server, waits for the reply, and then installs TLS handlers on the session if the request succeeded.

Lasterror is set.

The items on this page are in the following plugins: MBS Network Plugin.


The biggest plugin in space...