ILDAPProvider

interface OCP\LDAP\ILDAPProvider
Interface ILDAPProvider
Source:lib/public/LDAP/ILDAPProvider.php#36

Methods

public OCP\LDAP\ILDAPProvider::getUserDN($uid)
Translate a user id to LDAP DN.
Source:

lib/public/LDAP/ILDAPProvider.php#43

Parameters:
  • $uid (string) user id
Returns:

string

Since:

11.0.0

public OCP\LDAP\ILDAPProvider::getGroupDN($gid)
Translate a group id to LDAP DN.
Source:

lib/public/LDAP/ILDAPProvider.php#51

Parameters:
  • $gid (string) group id
Returns:

string

Since:

13.0.0

public OCP\LDAP\ILDAPProvider::getUserName($dn)
Translate a LDAP DN to an internal user name.
Source:

lib/public/LDAP/ILDAPProvider.php#60

Parameters:
  • $dn (string) LDAP DN
Returns:

string with the internal user name

Throws:

\Exception if translation was unsuccessful

Since:

11.0.0

public OCP\LDAP\ILDAPProvider::DNasBaseParameter($dn)
Convert a stored DN so it can be used as base parameter for LDAP queries.
Source:

lib/public/LDAP/ILDAPProvider.php#68

Parameters:
  • $dn (string) the DN
Returns:

string

Since:

11.0.0

public OCP\LDAP\ILDAPProvider::sanitizeDN($dn)
Sanitize a DN received from the LDAP server.
Source:

lib/public/LDAP/ILDAPProvider.php#76

Parameters:
  • $dn (array) the DN in question
Returns:

array the sanitized DN

Since:

11.0.0

public OCP\LDAP\ILDAPProvider::getLDAPConnection($uid)
Return a new LDAP connection resource for the specified user.
Source:

lib/public/LDAP/ILDAPProvider.php#84

Parameters:
  • $uid (string) user id
Returns:

resource of the LDAP connection

Since:

11.0.0

public OCP\LDAP\ILDAPProvider::getGroupLDAPConnection($gid)
Return a new LDAP connection resource for the specified group.
Source:

lib/public/LDAP/ILDAPProvider.php#92

Parameters:
  • $gid (string) group id
Returns:

resource of the LDAP connection

Since:

13.0.0

public OCP\LDAP\ILDAPProvider::getLDAPBaseUsers($uid)
Get the LDAP base for users.
Source:

lib/public/LDAP/ILDAPProvider.php#101

Parameters:
  • $uid (string) user id
Returns:

string the base for users

Throws:

\Exception if user id was not found in LDAP

Since:

11.0.0

public OCP\LDAP\ILDAPProvider::getLDAPBaseGroups($uid)
Get the LDAP base for groups.
Source:

lib/public/LDAP/ILDAPProvider.php#110

Parameters:
  • $uid (string) user id
Returns:

string the base for groups

Throws:

\Exception if user id was not found in LDAP

Since:

11.0.0

public OCP\LDAP\ILDAPProvider::dnExists($dn)
Check whether a LDAP DN exists
Source:

lib/public/LDAP/ILDAPProvider.php#118

Parameters:
  • $dn (string) LDAP DN
Returns:

bool whether the DN exists

Since:

11.0.0

public OCP\LDAP\ILDAPProvider::clearCache($uid)
Clear the cache if a cache is used, otherwise do nothing.
Source:

lib/public/LDAP/ILDAPProvider.php#125

Parameters:
  • $uid (string) user id
Since:

11.0.0

public OCP\LDAP\ILDAPProvider::clearGroupCache($gid)
Clear the cache if a cache is used, otherwise do nothing.
Source:

lib/public/LDAP/ILDAPProvider.php#132

Parameters:
  • $gid (string) group id
Since:

13.0.0

public OCP\LDAP\ILDAPProvider::getLDAPDisplayNameField($uid)
Get the LDAP attribute name for the user’s display name
Source:

lib/public/LDAP/ILDAPProvider.php#141

Parameters:
  • $uid (string) user id
Returns:

string the display name field

Throws:

\Exception if user id was not found in LDAP

Since:

12.0.0

public OCP\LDAP\ILDAPProvider::getLDAPEmailField($uid)
Get the LDAP attribute name for the email
Source:

lib/public/LDAP/ILDAPProvider.php#150

Parameters:
  • $uid (string) user id
Returns:

string the email field

Throws:

\Exception if user id was not found in LDAP

Since:

12.0.0

public OCP\LDAP\ILDAPProvider::getLDAPGroupMemberAssoc($gid)
Get the LDAP attribute name for the type of association betweeen users and groups
Source:

lib/public/LDAP/ILDAPProvider.php#159

Parameters:
  • $gid (string) group id
Returns:

string the configuration, one of: ‘memberUid’, ‘uniqueMember’, ‘member’, ‘gidNumber’, ‘’

Throws:

\Exception if group id was not found in LDAP

Since:

13.0.0

public OCP\LDAP\ILDAPProvider::getUserAttribute($uid, $attribute)
Get an LDAP attribute for a nextcloud user
Source:

lib/public/LDAP/ILDAPProvider.php#169

Parameters:
  • $uid (string) the nextcloud user id to get the attribute for
  • $attribute (string) the name of the attribute to read
Returns:

string | null

Throws:

\Exception if user id was not found in LDAP

Since:

21.0.0