Nextcloud PHP API (stable18)

UserInterface

TODO actually this is a IUserBackend

Tags
since
4.5.0

Table of Contents

deleteUser()  : bool
delete a user
getDisplayName()  : string
get display name of the user
getDisplayNames()  : array
Get a list of all display names and user ids.
getUsers()  : string[]
Get a list of all users
hasUserListings()  : bool
Check if a user list is available or not
implementsActions()  : bool
Check if backend implements actions
userExists()  : bool
check if a user exists

Methods

deleteUser()

delete a user

public deleteUser(string $uid) : bool
Parameters
$uid : string

The username of the user to delete

Tags
since
4.5.0
Return values
bool

getDisplayName()

get display name of the user

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

user ID of the user

Tags
since
4.5.0
Return values
string

display name

getDisplayNames()

Get a list of all display names and user ids.

public getDisplayNames([string $search = '' ][, string|null $limit = null ][, string|null $offset = null ]) : array
Parameters
$search : string = ''
$limit : string|null = null
$offset : string|null = null
Tags
since
4.5.0
Return values
array

an array of all displayNames (value) and the corresponding uids (key)

getUsers()

Get a list of all users

public getUsers([string $search = '' ][, null|int $limit = null ][, null|int $offset = null ]) : string[]
Parameters
$search : string = ''
$limit : null|int = null
$offset : null|int = null
Tags
since
4.5.0
Return values
string[]

an array of all uids

hasUserListings()

Check if a user list is available or not

public hasUserListings() : bool
Tags
since
4.5.0
Return values
bool

if users can be listed or not

implementsActions()

Check if backend implements actions

public implementsActions(int $actions) : bool
Parameters
$actions : int

bitwise-or'ed actions

Tags
since
4.5.0
deprecated
14.0.0

Switch to the interfaces from OCP\User\Backend

Return values
bool

Returns the supported actions as int to be compared with \OC\User\Backend::CREATE_USER etc.

userExists()

check if a user exists

public userExists(string $uid) : bool
Parameters
$uid : string

the username

Tags
since
4.5.0
Return values
bool

Search results