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...")
 
 
(One intermediate revision by the same user not shown)
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 20: Line 20:
 
|valign="top"|cPassword||valign="top"|Yes||valign="top"|The password of the user
 
|valign="top"|cPassword||valign="top"|Yes||valign="top"|The password of the user
 
|-
 
|-
|valign="top"|cLdapServer[:port]||valign="top"|No||valign="top"|The server hostname or IP address.  The port number can also be specified.<br>If the environment variable [[LIANJA_LDAP_SERVER]] is set, cLdapServer can be omitted.
+
|valign="top"|cLdapServer[:port]||valign="top"|No||valign="top"|The server hostname or IP address.  The port number can also be specified (defaults to :389).<br>If the environment variable [[LIANJA_LDAP_SERVER]] is set, cLdapServer can be omitted.
 
|-
 
|-
 
|valign="top"|cLdapBasedn||valign="top"|No||valign="top"|The Base DN.<br>If the environment variable [[LIANJA_LDAP_BASEDN]] is set, cLdapBasedn can be omitted.
 
|valign="top"|cLdapBasedn||valign="top"|No||valign="top"|The Base DN.<br>If the environment variable [[LIANJA_LDAP_BASEDN]] is set, cLdapBasedn can be omitted.
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>
  

Latest revision as of 11:51, 13 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 (defaults to :389).
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