Servoy Properties Summary | |
---|---|
Object | groupType |
Object | instanceType |
Object | member |
Object | name |
Servoy Methods Summary | |
---|---|
void | deleteValue( String ) |
byte[] | getByteValue( String ) |
Object | getDN( ) |
Object | getValue( String ) |
Boolean | save( ) |
void | setPassword( String, Object ) |
void | setPassword( String, Object, String ) |
void | setValue( String, Object ) |
Boolean | verifyPassword( String, String ) |
Servoy Properties Details |
---|
groupType
Object groupType
Get/Set a group typeReturns
Object type 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);
instanceType
Object instanceType
Get/Set an instance typeReturns
Object type 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);
member
Object member
Get/Set a memberReturns
Object member 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);
name
Object name
Get/Set the nameReturns
Object name 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);
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);
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 )
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);
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);
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);