Table of Contents
LDAP4D Directory at A Dog And His Boy

LDAP4D Directory - Public Methods

   

About this section...

These methods are distributed with LDAP4D Directory Demo Application and are required for any installation of LDAP4D Directory. 

These methods are installed by dragging them from the Explorer of one database to the Explorer of another.


LDAPDu_DirectoryHandler_NTK

Syntax:

LDAPu_DirectoryHandler_NTK 

Description:

The primary method for handling an LDAP request to the directory. Usually, there are a number of these running in separate processes waiting on requests. If a bind request is at the beginning of the session, it checks the given username and password against the bind arrays set in LDAPD_BindArraysSet

Warning:

 

Note:

If a Bind is not required (see LDAPD_BindRequired), any Bind request is essentially ignored and treated as an anonymous request.

Params:

None

Example:

LDAPu_DirectoryHandler_NTK

LDAPDu_FilterOps2Query

Syntax:

LDAPu_FilterOps2Query (->SearchOperators;->SearchValues;->SearchAttributes;->AttributeNames;->AttributeFieldPointers;->RequestedAttributes;->AttributeModifiers)

Description:

This uses the results of arrays populated in LDAPD_ParseSearchRequest to create a selection of records that can be used to return results with LDAPDu_SendSearchResponse .

Warning:


Note:

AttributeNames and AttributeFieldPointers arrays are populated when starting the directory in LDAPDu_Mapfields . RequestedAttributes, SearchValues, SearchOperators, and AttributeModifiers are populated when calling LDAPD_ParseSearchRequest.

Params:

In/Out

Parameter

Type

 

Example or note

->

pAttributeNames

Pointer

Pointer to a text array of LDAP attribute names.

 set in LDAPu_MapFields

->

pAttributeFieldPointers

Pointer

Pointer to an array of pointers to attribute fields.

set in LDAPu_MapFields

->

pSearchAttributes

Pointer

Pointer to a text array of attribute types.

 

->

pSearchValues

Pointer

Pointer to an array of attribute values.

 

->

pSearchOperators

Pointer

Pointer to array of Operators ("and", "or", "not") for LDAP search filter parsed from search request.

 

->

pAttributeModifiers

Pointer

Pointer to a text array of attribute modifiers( "=", "initial", "any", "final", ">=", "<=", "present", "approxMatch" ).

 

->

pRequestedAttributes

Pointer

Pointer to a text array of attribute values.

 

<-

result

Longint

success or failure

0 = noErr

Example:

LDAPu_FilterOps2Query(->SearchOperators;->SearchValues;->SearchAttributes;->AttributeNames;->AttributeFieldPtrs;->RequestedAttributes;->AttributeModifiers)


LDAPDu_MapFields

Syntax:

LDAPu_MapFields 

Description:

Map LDAP attributes to fields in the directory database.

Warning:


Note:

Sets arrays ta_LDAPD_AttributeNames and pa_LDAPD_AttributeFieldPointers

Params:

None

Example:

LDAPu_MapFields

LDAPDu_ErrorHandler

Syntax:

LDAPu_ErrorHandler 

Description:

Error handler stub for 4D calls.

Warning:


Note:


Params:

None

Example:

LDAPu_ErrorHandler

LDAPDu_NTK_ErrorHandler

Syntax:

LDAPu_NTK_ErrorHandler 

Description:

Error handler stub for NTK calls. Call NTK Set Error Handler in LDAPDu_StartDirectory

Warning:


Note:


Params:

None

Example:

LDAPu_NTK_ErrorHandler

LDAPDu_RequestHandler

Syntax:

LDAPu_RequestHandler ( pBuffer:P; tMode:T)

Description:

 Parse and handle bind, unbind, search, or abandon
 Scenarios:
  1. need a bind: use LDAPD_RequireBind
  2. if no bind needed, execute a search as an anonymous bind.

Warning:

LDAP Controls are not supported.

Note:

This method consumes octets from the input buffer.

Params:

In/Out

Parameter

Type

 

Example or note

->

pInputBuffer

Pointer

Pointer to blob input receive buffer.

 

->

tMode

Text

mode for processing input. Valid values:  "All" or "Search" - "All" will process bind requests, "Search" will process search requests.

 

Example:

LDAPu_RequestHandler(->oBuffer;"All")

LDAPDu_SendSearchResponse

Syntax:

result := LDAPu_SendSearchResponse ( sessionID:LI; messageID:LI )

Description:

Use the selection created in LDAPDu_FilterOps2Query to create and send SearchResults with LDAPD_MessageSend, and then finishes up with SearchResultDone.
Called from LDAPDu_RequestHandler.

Warning:

When responding to a search with search results, they must always be followed by a SearchResultDone - even if there were no results.

Note:

The message ID should be the same as message ID from the incoming search request.

Params:

In/Out

Parameter

Type

 

Example or note

->

sessionID

Longint

Distinguished name of directory tree entry to be added.

 

->

messageID

Longint

Message ID of the LDAP message.

 

<-

result

Longint

success or failure

0 = noErr

Example:

$iErr:=LDAPu_SendSearchResponse(iLDAPD_SessionID;$iMessageID)
If ($iErr = 0)
ALERT("Success!")
End IF

LDAPDu_StartDirectory

Syntax:

 LDAPu_StartDirectory 

Description:

Start the directory server.

Warning:

Remember to initialize the component first.

Note:


Params:

None

Example:

 LDAPu_StartDirectory



LDAPDu_StartDirectory_NTK

Syntax:

LDAPu_StartDirectory_NTK

Description:

Starts handlers used by directory.

Warning:

 

Note:


Params:

None

Example:

LDAPu_StartDirectory_NTK


Back to top