Nextcloud PHP API (master)

ILDAPProvider

Interface ILDAPProvider

Tags
since
11.0.0

Table of Contents

Methods

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()  : Connection|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()  : Connection|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 between users and groups
getMultiValueUserAttribute()  : array<string|int, mixed>
Get a multi-value LDAP attribute for a nextcloud user
getUserAttribute()  : string|null
Get an LDAP attribute for a nextcloud user
getUserDN()  : string
Translate a user id to LDAP DN.
getUserName()  : string
Translate a LDAP DN to an internal user name.
sanitizeDN()  : array<string|int, mixed>
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

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

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) : Connection|resource
Parameters
$gid : string

group id

Tags
since
13.0.0
Return values
Connection|resource

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) : Connection|resource
Parameters
$uid : string

user id

Tags
since
11.0.0
Return values
Connection|resource

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 between 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', ''

getMultiValueUserAttribute()

Get a multi-value LDAP attribute for a nextcloud user

public getMultiValueUserAttribute(string $uid, string $attribute) : array<string|int, mixed>
Parameters
$uid : string
$attribute : string
Tags
throws
Exception

if user id was not found in LDAP

since
22.0.0
Return values
array<string|int, mixed>

getUserAttribute()

Get an LDAP attribute for a nextcloud user

public getUserAttribute(string $uid, string $attribute) : string|null
Parameters
$uid : string
$attribute : string
Tags
throws
Exception

if user id was not found in LDAP

since
21.0.0
Return values
string|null

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<string|int, mixed> $dn) : array<string|int, mixed>
Parameters
$dn : array<string|int, mixed>

the DN in question

Tags
since
11.0.0
Return values
array<string|int, mixed>

the sanitized DN


        
On this page

Search results