Nextcloud PHP API (master)

UserInterface

TODO actually this is a IUserBackend

Tags
since
4.5.0

Table of Contents

Methods

deleteUser()  : bool
delete a user
getDisplayName()  : string
get display name of the user
getDisplayNames()  : array<string|int, mixed>
Get a list of all display names and user ids.
getUsers()  : array<string|int, 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 = '' ][, int|null $limit = null ][, int|null $offset = null ]) : array<string|int, mixed>
Parameters
$search : string = ''
$limit : int|null = null
$offset : int|null = null
Tags
since
4.5.0
Return values
array<string|int, mixed>

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 ]) : array<string|int, string>
Parameters
$search : string = ''
$limit : null|int = null
$offset : null|int = null
Tags
since
4.5.0
Return values
array<string|int, 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

        
On this page

Search results