publish
plugins.it2be_ldapclient.ILContact info


Servoy Properties Summary
Object ID
Object comment
Object company
Object country
Object department
Object facsimile
Object fullName
Object givenName
Object homeCountry
Object homeDirectory
Object homeFax
Object homeLocality
Object homePhone
Object homePostalAddress
Object homeState
Object homeURL
Object homeZip
Object locality
Object mail
Object mailNickName
Object memberOf
Object mobile
Object otherMailbox
Object pager
Object postalCode
Object prefix
Object rfc822Mailbox
Object state
Object streetAddress
Object suffix
Object surName
Object telephoneNumber
Object title
Object userPassword


Servoy Methods Summary
void deleteValue( String )
byte[] getByteValue( String )
Object getDN( )
Object getUID( )
Object getValue( String )
Boolean save( )
void setPassword( String, Object, String )
void setPassword( String, Object )
void setValue( String, Object )
Boolean verifyPassword( String, String )


Servoy Properties Details


ID
Object  ID
Get/Set the id of the entry.
Returns
Object  id Object

Supported Clients
SmartClient, WebClient, NGClient


comment
Object  comment
Get/Set the comment of the entry.
Returns
Object  comment Object

Supported Clients
SmartClient, WebClient, NGClient


company
Object  company
Get/Set the company of the entry.
Returns
Object  company Object

Supported Clients
SmartClient, WebClient, NGClient


country
Object  country
Get/Set the country of the entry.
Returns
Object  country Object

Supported Clients
SmartClient, WebClient, NGClient


department
Object  department
Get/Set the department of the entry.
Returns
Object  department Object

Supported Clients
SmartClient, WebClient, NGClient


facsimile
Object  facsimile
Get/Set the facsimile of the entry.
Returns
Object  facsimile Object

Supported Clients
SmartClient, WebClient, NGClient


fullName
Object  fullName
Get/Set the full name of the entry.
Returns
Object  name Object

Supported Clients
SmartClient, WebClient, NGClient


givenName
Object  givenName
Get/Set the given name of the entry.
Returns
Object  name Object

Supported Clients
SmartClient, WebClient, NGClient


homeCountry
Object  homeCountry
Get/Set the home country of the entry.
Returns
Object  country Object

Supported Clients
SmartClient, WebClient, NGClient


homeDirectory
Object  homeDirectory
Get/Set the home directory of the entry.
Returns
Object  directory Object

Supported Clients
SmartClient, WebClient, NGClient


homeFax
Object  homeFax
Get/Set the home fax of the entry.
Returns
Object  fax Object

Supported Clients
SmartClient, WebClient, NGClient


homeLocality
Object  homeLocality
Get/Set the home locality of the entry.
Returns
Object  locality Object

Supported Clients
SmartClient, WebClient, NGClient


homePhone
Object  homePhone
Get/Set the home phone of the entry.
Returns
Object  phone Object

Supported Clients
SmartClient, WebClient, NGClient


homePostalAddress
Object  homePostalAddress
Get/Set the home postal address of the entry.
Returns
Object  address Object

Supported Clients
SmartClient, WebClient, NGClient


homeState
Object  homeState
Get/Set the home state of the entry.
Returns
Object  state Object

Supported Clients
SmartClient, WebClient, NGClient


homeURL
Object  homeURL
Get/Set the home url of the entry.
Returns
Object  url Object

Supported Clients
SmartClient, WebClient, NGClient


homeZip
Object  homeZip
Get/Set the home zip of the entry.
Returns
Object  zip Object

Supported Clients
SmartClient, WebClient, NGClient


locality
Object  locality
Get/Set the locality of the entry.
Returns
Object  locality Object

Supported Clients
SmartClient, WebClient, NGClient


mail
Object  mail
Get/Set the email of the entry.
Returns
Object  email Object

Supported Clients
SmartClient, WebClient, NGClient


mailNickName
Object  mailNickName
Get/Set the mail nickname of the entry.
Returns
Object  nickname Object

Supported Clients
SmartClient, WebClient, NGClient


memberOf
Object  memberOf
Get/Set the member of of the entry.
Returns
Object  member Object

Supported Clients
SmartClient, WebClient, NGClient


mobile
Object  mobile
Get/Set the mobile of the entry.
Returns
Object  mobile Object

Supported Clients
SmartClient, WebClient, NGClient


otherMailbox
Object  otherMailbox
Get/Set the other mailbox of the entry.
Returns
Object  mailbox Object

Supported Clients
SmartClient, WebClient, NGClient


pager
Object  pager
Get/Set the pager of the entry.
Returns
Object  pager Object

Supported Clients
SmartClient, WebClient, NGClient


postalCode
Object  postalCode
Get/Set the postalcode of the entry.
Returns
Object  postalCode Object

Supported Clients
SmartClient, WebClient, NGClient


prefix
Object  prefix
Get/Set the prefix of the entry.
Returns
Object  prefix Object

Supported Clients
SmartClient, WebClient, NGClient


rfc822Mailbox
Object  rfc822Mailbox
Get/Set the rfc822 mailbox of the entry.
Returns
Object  mailbox Object

Supported Clients
SmartClient, WebClient, NGClient


state
Object  state
Get/Set the state of the entry.
Returns
Object  state Object

Supported Clients
SmartClient, WebClient, NGClient


streetAddress
Object  streetAddress
Get/Set the street address of the entry.
Returns
Object  address Object

Supported Clients
SmartClient, WebClient, NGClient


suffix
Object  suffix
Get/Set the suffix of the entry.
Returns
Object  suffix Object

Supported Clients
SmartClient, WebClient, NGClient


surName
Object  surName
Get/Set the surname of the entry.
Returns
Object  surname Object

Supported Clients
SmartClient, WebClient, NGClient


telephoneNumber
Object  telephoneNumber
Get/Set the telephone number of the entry.
Returns
Object  number Object

Supported Clients
SmartClient, WebClient, NGClient


title
Object  title
Get/Set the title of the entry.
Returns
Object  title Object

Supported Clients
SmartClient, WebClient, NGClient


userPassword
Object  userPassword
Get/Set the user password of the entry.
Returns
Object  password Object

Supported Clients
SmartClient, WebClient, NGClient

Servoy Methods Details


deleteValue
void  deleteValue( String )
Delete the value by the Distinguished Name.
Parameters
String  name  the name

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// This is an example of how to find a group and its members in an Active Directory
// The group we search in is the group Manager
var connection = plugins.it2be_ldapclient.getConnection(
"xxx.xxx.xxx.xxx",
"cn=login,cn=users,dc=domain,dc=it2be,dc=com",
"password");

var set = plugins.it2be_ldapclient.getLDAPSet(
"cn=users,dc=office,dc=it2be,dc=com",
connection);

// When something went wrong with the search the LDAPSet will be returned empty
if (set != null) {
var output = ""

// Loop through the LDAPSet
for (var i = 1 ; i < set.getSize() ; i++) {
// Set the selected index of the found LDAPSet
set.setSelectedIndex(i);

var group = set.getGroup();

if (group.getName() == "Management") {
// Proof of what a raw output results to
application.output(set.getRaw());

// Output entries by name
output += "Name:	   " + group.getName() + "\n";
output += "ILGroup Type: " + group.getGroupType() + "\n";
output += "Member:	 " + group.getMember() + "\n";
}
}
} else {
output = "No connection possible.";
}

application.output(output);


getByteValue
byte[]  getByteValue( String )
Get the byte value by attribute name.
Parameters
String  attribute  the attribute

Returns
byte[]  value byte[]

Supported Clients
SmartClient, WebClient, NGClient


getDN
Object  getDN( )
Retrieve the Distinguished Name of the entry.
Returns
Object  value Object

Supported Clients
SmartClient, WebClient, NGClient

Sample
// This is an example of how to find a group and its members in an Active Directory
// The group we search in is the group Manager
var connection = plugins.it2be_ldapclient.getConnection(
"xxx.xxx.xxx.xxx",
"cn=login,cn=users,dc=domain,dc=it2be,dc=com",
"password");

var set = plugins.it2be_ldapclient.getLDAPSet(
"cn=users,dc=office,dc=it2be,dc=com",
connection);

// When something went wrong with the search the LDAPSet will be returned empty
if (set != null) {
var output = ""

// Loop through the LDAPSet
for (var i = 1 ; i < set.getSize() ; i++) {
// Set the selected index of the found LDAPSet
set.setSelectedIndex(i);

var group = set.getGroup();

if (group.getName() == "Management") {
// Proof of what a raw output results to
application.output(set.getRaw());

// Output entries by name
output += "Name:	   " + group.getName() + "\n";
output += "ILGroup Type: " + group.getGroupType() + "\n";
output += "Member:	 " + group.getMember() + "\n";
}
}
} else {
output = "No connection possible.";
}

application.output(output);


getUID
Object  getUID( )
Get/Set the uid of the entry.
Returns
Object  uid Object

Supported Clients
SmartClient, WebClient, NGClient


getValue
Object  getValue( String )
Get the value by attribute name.
Parameters
String  attribute  the attribute

Returns
Object  value Object

Supported Clients
SmartClient, WebClient, NGClient

Sample
// This is an example of how to find a group and its members in an Active Directory
// The group we search in is the group Manager
var connection = plugins.it2be_ldapclient.getConnection(
"xxx.xxx.xxx.xxx",
"cn=login,cn=users,dc=domain,dc=it2be,dc=com",
"password");

var set = plugins.it2be_ldapclient.getLDAPSet(
"cn=users,dc=office,dc=it2be,dc=com",
connection);

// When something went wrong with the search the LDAPSet will be returned empty
if (set != null) {
var output = ""

// Loop through the LDAPSet
for (var i = 1 ; i < set.getSize() ; i++) {
// Set the selected index of the found LDAPSet
set.setSelectedIndex(i);

var group = set.getGroup();

if (group.getName() == "Management") {
// Proof of what a raw output results to
application.output(set.getRaw());

// Output entries by name
output += "Name:	   " + group.getName() + "\n";
output += "ILGroup Type: " + group.getGroupType() + "\n";
output += "Member:	 " + group.getMember() + "\n";
}
}
} else {
output = "No connection possible.";
}

application.output(output);


save
Boolean  save( )
Save the changes (when authorized).
Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// This is an example of how to find a group and its members in an Active Directory
// The group we search in is the group Manager
var connection = plugins.it2be_ldapclient.getConnection(
"xxx.xxx.xxx.xxx",
"cn=login,cn=users,dc=domain,dc=it2be,dc=com",
"password");

var set = plugins.it2be_ldapclient.getLDAPSet(
"cn=users,dc=office,dc=it2be,dc=com",
connection);

// When something went wrong with the search the LDAPSet will be returned empty
if (set != null) {
var output = ""

// Loop through the LDAPSet
for (var i = 1 ; i < set.getSize() ; i++) {
// Set the selected index of the found LDAPSet
set.setSelectedIndex(i);

var group = set.getGroup();

if (group.getName() == "Management") {
// Proof of what a raw output results to
application.output(set.getRaw());

// Output entries by name
output += "Name:	   " + group.getName() + "\n";
output += "ILGroup Type: " + group.getGroupType() + "\n";
output += "Member:	 " + group.getMember() + "\n";
}
}
} else {
output = "No connection possible.";
}

application.output(output);


setPassword
void  setPassword( String, Object, String )
Add or replace the password using the selected encryption (PLAIN, MD5, SMD5, SHA*, SSHA).
Parameters
String  attribute  the attribute
Object  password  the password
String  encryption  the encryption

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Add or replace the password using the selected encryption (PLAIN, MD5, SMD5, SHA*, SSHA).

// Check the global method to see how you can create a connection
var connection = globals.getConnection();

// Check that the credentials are correct and connecting is allowed
var result = plugins.it2be_ldapclient.isAuthorized(connection);

if (result) {
application.output("This person is allowed to log in!");
} else {
application.output("This person is not allowed to log in!");

Return;
}

// Create a (native) LDAP set
var set = plugins.it2be_ldapclient.getLDAPSet("o=users", connection);

// retrieve an entry by selected index
set.setSelectedIndex(6);

var entry = set.getEntry();

application.output(entry.getDN());

// Be careful, whenever editing fails it could have to do with either:
// Setting a password can best be done by using the delivered options for encrypting: PLAIN, MD5, SMD5, SHA, SSHA
// Not all encryption methods are accepted by all servers (eDirectory seems to accept only PLAIN)
// In other words, make sure you full and correct information from the system manager
entry.setPassword("userPassword", "marcel", "SHA");

var success = entry.save()

if(!success) {
application.output("One or more attributes has failed, check the log");
}

application.output(entry);


setPassword
void  setPassword( String, Object )
Add or replace the password using the selected encryption (PLAIN, MD5, SMD5, SHA*, SSHA).
Parameters
String  attribute  the attribute
Object  password  the password

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Add or replace the password using the selected encryption (PLAIN, MD5, SMD5, SHA*, SSHA).

// Check the global method to see how you can create a connection
var connection = globals.getConnection();

// Check that the credentials are correct and connecting is allowed
var result = plugins.it2be_ldapclient.isAuthorized(connection);

if (result) {
application.output("This person is allowed to log in!");
} else {
application.output("This person is not allowed to log in!");

Return;
}

// Create a (native) LDAP set
var set = plugins.it2be_ldapclient.getLDAPSet("o=users", connection);

// retrieve an entry by selected index
set.setSelectedIndex(6);

var entry = set.getEntry();

application.output(entry.getDN());

// Be careful, whenever editing fails it could have to do with either:
// Setting a password can best be done by using the delivered options for encrypting: PLAIN, MD5, SMD5, SHA, SSHA
// Not all encryption methods are accepted by all servers (eDirectory seems to accept only PLAIN)
// In other words, make sure you full and correct information from the system manager
entry.setPassword("userPassword", "marcel", "SHA");

var success = entry.save()

if(!success) {
application.output("One or more attributes has failed, check the log");
}

application.output(entry);


setValue
void  setValue( String, Object )
Set the value by attribute name.
Parameters
String  attribute  the attribute
Object  value  the value

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Set the value by attribute name.
// This is an example of how to find a group and its members in an Active Directory
// The group we search in is the group Manager
var connection = plugins.it2be_ldapclient.getConnection(
"xxx.xxx.xxx.xxx",
"cn=login,cn=users,dc=domain,dc=it2be,dc=com",
"password");

var set = plugins.it2be_ldapclient.getLDAPSet(
"cn=users,dc=office,dc=it2be,dc=com",
connection);

// When something went wrong with the search the LDAPSet will be returned empty
if (set != null) {
var output = ""

// Loop through the LDAPSet
for (var i = 1 ; i < set.getSize() ; i++) {
// Set the selected index of the found LDAPSet
set.setSelectedIndex(i);

var group = set.getGroup();

if (group.getName() == "Management") {
// Proof of what a raw output results to
application.output(set.getRaw());

// Output entries by name
output += "Name:	   " + group.getName() + "\n";
output += "ILGroup Type: " + group.getGroupType() + "\n";
output += "Member:	 " + group.getMember() + "\n";
}
}
} else {
output = "No connection possible.";
}

application.output(output);


verifyPassword
Boolean  verifyPassword( String, String )
Verify the password.
Parameters
String  attribute  the attribute
String  password  the password

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Verify the password.
// This is an example of how to find a group and its members in an Active Directory
// The group we search in is the group Manager
var connection = plugins.it2be_ldapclient.getConnection(
"xxx.xxx.xxx.xxx",
"cn=login,cn=users,dc=domain,dc=it2be,dc=com",
"password");

var set = plugins.it2be_ldapclient.getLDAPSet(
"cn=users,dc=office,dc=it2be,dc=com",
connection);

// When something went wrong with the search the LDAPSet will be returned empty
if (set != null) {
var output = ""

// Loop through the LDAPSet
for (var i = 1 ; i < set.getSize() ; i++) {
// Set the selected index of the found LDAPSet
set.setSelectedIndex(i);

var group = set.getGroup();

if (group.getName() == "Management") {
// Proof of what a raw output results to
application.output(set.getRaw());

// Output entries by name
output += "Name:	   " + group.getName() + "\n";
output += "ILGroup Type: " + group.getGroupType() + "\n";
output += "Member:	 " + group.getMember() + "\n";
}
}
} else {
output = "No connection possible.";
}

application.output(output);