Backend

class OC\User\Backend
Abstract base class for user management. Provides methods for querying backend
capabilities.
Source:lib/private/User/Backend.php#33
Implements:OCP\UserInterface

Constants

NOT_IMPLEMENTED = -501
error code for functions not provided by the user backend
Source:lib/private/User/Backend.php#37
CREATE_USER = 1
actions that user backends can define
Source:lib/private/User/Backend.php#42
SET_PASSWORD = 16
Source:lib/private/User/Backend.php#43
CHECK_PASSWORD = 256
Source:lib/private/User/Backend.php#44
GET_HOME = 4096
Source:lib/private/User/Backend.php#45
GET_DISPLAYNAME = 65536
Source:lib/private/User/Backend.php#46
SET_DISPLAYNAME = 1048576
Source:lib/private/User/Backend.php#47
PROVIDE_AVATAR = 16777216
Source:lib/private/User/Backend.php#48
COUNT_USERS = 268435456
Source:lib/private/User/Backend.php#49

Properties

protected static property OC\User\Backend::$possibleActions
Source:lib/private/User/Backend.php#51

Methods

public OC\User\Backend::getSupportedActions()
Get all supported actions
Source:

lib/private/User/Backend.php#69

Returns:

int bitwise-or’ed actions

Returns the supported actions as int to be compared with self::CREATE_USER etc.

public OC\User\Backend::implementsActions($actions)
Check if backend implements actions
Source:

lib/private/User/Backend.php#88

Parameters:
  • $actions (int) bitwise-or’ed actions
Returns:

bool Returns the supported actions as int to be compared with self::CREATE_USER etc.

public OC\User\Backend::deleteUser($uid)
delete a user
Source:

lib/private/User/Backend.php#99

Parameters:
  • $uid (string) The username of the user to delete
Returns:

bool Deletes a user

public OC\User\Backend::getUsers($search="", $limit=null, $offset=null)
Get a list of all users
Source:

lib/private/User/Backend.php#111

Parameters:
  • $search (string)
  • $limit (null | int)
  • $offset (null | int)
Returns:

string[] an array of all uids

public OC\User\Backend::userExists($uid)
check if a user exists
Source:

lib/private/User/Backend.php#120

Parameters:
  • $uid (string) the username
Returns:

bool

public OC\User\Backend::getHome($uid)
get the user’s home directory
Source:

lib/private/User/Backend.php#129

Parameters:
  • $uid (string) the username
Returns:

bool

public OC\User\Backend::getDisplayName($uid)
get display name of the user
Source:

lib/private/User/Backend.php#138

Parameters:
  • $uid (string) user ID of the user
Returns:

string display name

public OC\User\Backend::getDisplayNames($search="", $limit=null, $offset=null)
Get a list of all display names and user ids.
Source:

lib/private/User/Backend.php#150

Parameters:
  • $search (string)
  • $limit (int | null)
  • $offset (int | null)
Returns:

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

public OC\User\Backend::hasUserListings()
Check if a user list is available or not
Source:lib/private/User/Backend.php#163
Returns:bool if users can be listed or not