Nextcloud PHP API (stable19)

ILDAPProvider

Interface ILDAPProvider

Tags
since
11.0.0

Table of Contents

clearCache()  : mixed
Clear the cache if a cache is used, otherwise do nothing.
clearGroupCache()  : mixed
Clear the cache if a cache is used, otherwise do nothing.
DNasBaseParameter()  : string
Convert a stored DN so it can be used as base parameter for LDAP queries.
dnExists()  : bool
Check whether a LDAP DN exists
getGroupDN()  : string
Translate a group id to LDAP DN.
getGroupLDAPConnection()  : resource
Return a new LDAP connection resource for the specified group.
getLDAPBaseGroups()  : string
Get the LDAP base for groups.
getLDAPBaseUsers()  : string
Get the LDAP base for users.
getLDAPConnection()  : resource
Return a new LDAP connection resource for the specified user.
getLDAPDisplayNameField()  : string
Get the LDAP attribute name for the user's display name
getLDAPEmailField()  : string
Get the LDAP attribute name for the email
getLDAPGroupMemberAssoc()  : string
Get the LDAP attribute name for the type of association betweeen users and groups
getUserDN()  : string
Translate a user id to LDAP DN.
getUserName()  : string
Translate a LDAP DN to an internal user name.
sanitizeDN()  : array
Sanitize a DN received from the LDAP server.

Methods

clearCache()

Clear the cache if a cache is used, otherwise do nothing.

public clearCache(string $uid) : mixed
Parameters
$uid : string

user id

Tags
since
11.0.0
Return values
mixed

clearGroupCache()

Clear the cache if a cache is used, otherwise do nothing.

public clearGroupCache(string $gid) : mixed
Parameters
$gid : string

group id

Tags
since
13.0.0
Return values
mixed

DNasBaseParameter()

Convert a stored DN so it can be used as base parameter for LDAP queries.

public DNasBaseParameter(string $dn) : string
Parameters
$dn : string

the DN

Tags
since
11.0.0
Return values
string

dnExists()

Check whether a LDAP DN exists

public dnExists(string $dn) : bool
Parameters
$dn : string

LDAP DN

Tags
since
11.0.0
Return values
bool

whether the DN exists

getGroupDN()

Translate a group id to LDAP DN.

public getGroupDN(string $gid) : string
Parameters
$gid : string

group id

Tags
since
13.0.0
Return values
string

getGroupLDAPConnection()

Return a new LDAP connection resource for the specified group.

public getGroupLDAPConnection(string $gid) : resource
Parameters
$gid : string

group id

Tags
since
13.0.0
Return values
resource

of the LDAP connection

getLDAPBaseGroups()

Get the LDAP base for groups.

public getLDAPBaseGroups(string $uid) : string
Parameters
$uid : string

user id

Tags
throws
Exception

if user id was not found in LDAP

since
11.0.0
Return values
string

the base for groups

getLDAPBaseUsers()

Get the LDAP base for users.

public getLDAPBaseUsers(string $uid) : string
Parameters
$uid : string

user id

Tags
throws
Exception

if user id was not found in LDAP

since
11.0.0
Return values
string

the base for users

getLDAPConnection()

Return a new LDAP connection resource for the specified user.

public getLDAPConnection(string $uid) : resource
Parameters
$uid : string

user id

Tags
since
11.0.0
Return values
resource

of the LDAP connection

getLDAPDisplayNameField()

Get the LDAP attribute name for the user's display name

public getLDAPDisplayNameField(string $uid) : string
Parameters
$uid : string

user id

Tags
throws
Exception

if user id was not found in LDAP

since
12.0.0
Return values
string

the display name field

getLDAPEmailField()

Get the LDAP attribute name for the email

public getLDAPEmailField(string $uid) : string
Parameters
$uid : string

user id

Tags
throws
Exception

if user id was not found in LDAP

since
12.0.0
Return values
string

the email field

getLDAPGroupMemberAssoc()

Get the LDAP attribute name for the type of association betweeen users and groups

public getLDAPGroupMemberAssoc(string $gid) : string
Parameters
$gid : string

group id

Tags
throws
Exception

if group id was not found in LDAP

since
13.0.0
Return values
string

the configuration, one of: 'memberUid', 'uniqueMember', 'member', 'gidNumber', ''

getUserDN()

Translate a user id to LDAP DN.

public getUserDN(string $uid) : string
Parameters
$uid : string

user id

Tags
since
11.0.0
Return values
string

getUserName()

Translate a LDAP DN to an internal user name.

public getUserName(string $dn) : string
Parameters
$dn : string

LDAP DN

Tags
throws
Exception

if translation was unsuccessful

since
11.0.0
Return values
string

with the internal user name

sanitizeDN()

Sanitize a DN received from the LDAP server.

public sanitizeDN(array $dn) : array
Parameters
$dn : array

the DN in question

Tags
since
11.0.0
Return values
array

the sanitized DN

Search results