Adding an LDAP Site (AddLDAPSite)

Use the ICISites interface AddLDAPSite method to add a Site that uses LDAP.

This method is available in EFT Server 4.3.4 and later.

 

HRESULT AddLDAPSite(

[in] BSTR bstrName, //Name

[in] BSTR bstrRootFolder, //Root folder

[in] BSTR bstrDomainContext, //LDAP domain context

[in] int nIP, //Listening IP

[in] long nPort, //FTP port

[in] VARIANT_BOOL bCreateHomeFolder,// Create home folders

// for newly-added users?

[in] VARIANT_BOOL bPermHomeFolder, //Give newly-added users full

//permission for their

// home folders?

[in] VARIANT_BOOL bAutoStart, //Start site

//immediately after creation?

[in] VARIANT_BOOL bCreateFTPFolders, //Create standard FTP folders

//(Usr, Bin, Incoming, Pub)?

[out, retval] ICISite** pSite); //New site interface

Example (VBScript):

Set Site = Sites.AddLDAPSite("LDAP Site", "C:\sites\LDAP", "", 0, 21, True, True, True, True)

 

Parameters

Definition

bstrName

New site name

bstrRootFolder

Site root folder

bstrDomainContext

LDAP domain components (e.g., DNS domain name)

bstrAllowGroup

LDAP group name (not used in version 6.1)

nIP

Index of the site IP address

nPort

Port number of the site

bCreateHomeFolder

TRUE means that a home folder for new site users should be created

bPermHomeFolder

TRUE means that new site users should be granted full permissions in their home folders

bAutoStart

TRUE means that the site should start automatically

bCreateFTPFolders

TRUE means to create standard FTP folders (Usr, Bin, Incoming, Pub)

 

You can also call Add(), setting "3" as the nAMID parameter to create an LDAP site.

Configuration Notes

The "bstrDomainContext" string that is passed in must be composed properly to define the parameters of the LDAP Site. The syntax is the same for both methods: a semicolon separated list of name/value pairs that defines the LDAP options.

The entire string is:

LDAPSERVER={IP or Hostname for LDAP server};LDAPPORT={port on LDAP server};BASEDN={base dn for users};USERFILTER={filter for LDAP query to return users};USERATTRIBUTE={what user attribute to use as client login};TYPE={0 for anonymous bind, 1 for simple bind};USERNAME={cn of the user to bind as for querying users};PASSWORD={password for that user};LDAPDB={path to AUD file};SSL={0 for no SSL, 1 for SSL};USESEARCHSCOPE={1 to set search scope, 0 otherwise};SEARCHSCOPE={search scope: 0 => base, 1 => one level, =>subtree};USESEARCHSIZELIMIT={1 to override search page size, 0 otherwise};SEARCHSIZELIMIT={new search page size};USETIMEOUT={1 to use timeout, 0 otherwise};TIMEOUT={timeout in seconds};USEVERSION={1 to use specific version, otherwise 0};VERSION={LDAP version (2 or 3)};USEPAGECONTROL={1 to use LDAP server side page control, 0 otherwise};USEREFERRALS={1 to turn on referral changing; 0 otherwise};USESEARCHATTRIBUTES={1 to select attributes; 0 otherwise };SEARCHATTRIBUTES={search attributes};

You do not have to include the entire string. Any options from USESEARCHSCOPE to the end can be omitted and EFT Server will use their default values.

Examples:

Set Site = Sites.AddLDAPSite("LDAP Site", "C:\sites\LDAP", "", 0, 21, True, True, True, True)

 

LDAPSERVER=fileserver;LDAPPORT=389;BASEDN=dc=s5development,dc=local;USERFILTER=(objectClass=person);USERATTRIBUTE=cn;TYPE=0;USERNAME=cn=Ivan Smithe,cn=users,dc=development,dc=local;PASSWORD=XXX;LDAPDDB=C:\EFT AppData\MySite.aud;SSL=0;USESEARCHSCOPE=1;SEARCHSCOPE=2;USESEARCHSIZELIMIT=1;SEARCHSIZELIMIT=1000;USETIMEOUT=1;TIMEOUT=60;USEVERSION=1;VERSION=3;USEPAGECONTROL=1;USEREFERRALS=0;USESEARCHATTRIBUTES=1;SEARCHATTRIBUTES=mail,e-mail,name,cn;