Difference between revisions of "LDAP LOGIN()"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Purpose== Function to test an LDAP/ActiveDirectory user login ==Syntax== LDAP_LOGIN(<cUsername>, <cPassword> [, <cLdapServer[:port]> [, <cLdapBasedn>]]) ==See Also== GET...")
 
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
Function to test an LDAP/ActiveDirectory user login
+
Function to test an LDAP/ActiveDirectory user login and return the Groups and Roles the user is a member of
  
 
==Syntax==
 
==Syntax==
Line 9: Line 9:
  
 
==Description==
 
==Description==
The LDAP_LOGIN() function returns .T. (true) if the specified LDAP/ActiveDirectory user successfully binds.
+
The LDAP_LOGIN() function returns the names of the Groups and Roles the specified LDAP/ActiveDirectory user is a member of if the user successfully binds.
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
Line 29: Line 29:
 
<code lang="recital">
 
<code lang="recital">
 
? ldap_login("Mandy Monroe","CcxkTpjFbfw2ulmv","192.168.80.139:389","OU=AD LDS Users,O=Lianja,C=UK"))
 
? ldap_login("Mandy Monroe","CcxkTpjFbfw2ulmv","192.168.80.139:389","OU=AD LDS Users,O=Lianja,C=UK"))
.T.
+
HR,Sales,Readers,Users
 
</code>
 
</code>
  

Revision as of 06:11, 12 October 2016

Purpose

Function to test an LDAP/ActiveDirectory user login and return the Groups and Roles the user is a member of

Syntax

LDAP_LOGIN(<cUsername>, <cPassword> [, <cLdapServer[:port]> [, <cLdapBasedn>]])

See Also

GETGID(), GETPID(), GETUID(), ID(), LDAP_USERROLES(), USER(), USERDOMAIN(), USEREMAIL(), USERFULLNAME(), USERNAME(), USERROLES(), USERTENANCY(), Users Tables

Description

The LDAP_LOGIN() function returns the names of the Groups and Roles the specified LDAP/ActiveDirectory user is a member of if the user successfully binds.

Parameter Required Description
cUsername Yes The name of the user
cPassword Yes The password of the user
cLdapServer[:port] No The server hostname or IP address. The port number can also be specified.
If the environment variable LIANJA_LDAP_SERVER is set, cLdapServer can be omitted.
cLdapBasedn No The Base DN.
If the environment variable LIANJA_LDAP_BASEDN is set, cLdapBasedn can be omitted.

Example

? ldap_login("Mandy Monroe","CcxkTpjFbfw2ulmv","192.168.80.139:389","OU=AD LDS Users,O=Lianja,C=UK"))
HR,Sales,Readers,Users