IUserManager

interface OCP\IUserManager
Class Manager
Hooks available in scope \OC\User:
- preSetPassword(\OC\User\User $user, string $password, string $recoverPassword)
- postSetPassword(\OC\User\User $user, string $password, string $recoverPassword)
- preDelete(\OC\User\User $user)
- postDelete(\OC\User\User $user)
- preCreateUser(string $uid, string $password)
- postCreateUser(\OC\User\User $user, string $password)
- assignedUserId(string $uid)
- preUnassignedUserId(string $uid)
- postUnassignedUserId(string $uid)
Implemented by:OC\User\Manager
Source:lib/public/IUserManager.php#49

Methods

public OCP\IUserManager::registerBackend($backend)
register a user backend
Source:

lib/public/IUserManager.php#56

Parameters:
Since:

8.0.0

public OCP\IUserManager::getBackends()
Get the active backends
Source:lib/public/IUserManager.php#63
Returns:\OCP\UserInterface[]
Since:8.0.0
public OCP\IUserManager::removeBackend($backend)
remove a user backend
Source:

lib/public/IUserManager.php#71

Parameters:
Since:

8.0.0

public OCP\IUserManager::clearBackends()
remove all user backends
Source:lib/public/IUserManager.php#77
Since:8.0.0
public OCP\IUserManager::get($uid)
get a user by user id
Source:

lib/public/IUserManager.php#86

Parameters:
  • $uid (string)
Returns:

\OCP\IUser | null Either the user or null if the specified user does not exist

Since:

8.0.0

public OCP\IUserManager::userExists($uid)
check if a user exists
Source:

lib/public/IUserManager.php#95

Parameters:
  • $uid (string)
Returns:

bool

Since:

8.0.0

public OCP\IUserManager::checkPassword($loginName, $password)
Check if the password is valid for the user
Source:

lib/public/IUserManager.php#105

Parameters:
  • $loginName (string)
  • $password (string)
Returns:

mixed the User object on success, false otherwise

Since:

8.0.0

public OCP\IUserManager::search($pattern, $limit=null, $offset=null)
search by user id
Source:

lib/public/IUserManager.php#116

Parameters:
  • $pattern (string)
  • $limit (int)
  • $offset (int)
Returns:

\OCP\IUser[]

Since:

8.0.0

public OCP\IUserManager::searchDisplayName($pattern, $limit=null, $offset=null)
search by displayName
Source:

lib/public/IUserManager.php#127

Parameters:
  • $pattern (string)
  • $limit (int)
  • $offset (int)
Returns:

\OCP\IUser[]

Since:

8.0.0

public OCP\IUserManager::searchKnownUsersByDisplayName($searcher, $pattern, $limit=null, $offset=null)
Search known users (from phonebook sync) by displayName
Source:

lib/public/IUserManager.php#139

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

\OCP\IUser[]

Since:

21.0.1

public OCP\IUserManager::createUser($uid, $password)
Source:

lib/public/IUserManager.php#148

Parameters:
  • $uid (string)
  • $password (string)
Throws:

\InvalidArgumentException

Returns:

bool | \OCP\IUser the created user or false

Since:

8.0.0

public OCP\IUserManager::createUserFromBackend($uid, $password, $backend)
Source:

lib/public/IUserManager.php#158

Parameters:
Returns:

\OCP\IUser | null

Throws:

\InvalidArgumentException

Since:

12.0.0

public OCP\IUserManager::countUsers()
returns how many users per backend exist (if supported by backend)
Source:lib/public/IUserManager.php#166
Returns:array an array of backend class as key and count number as value
Since:8.0.0
public OCP\IUserManager::callForAllUsers($callback, $search="")
Source:

lib/public/IUserManager.php#174

Parameters:
  • $callback (Closure)
  • $search (string)
Since:

9.0.0

public OCP\IUserManager::countDisabledUsers()
returns how many users have logged in once
Source:lib/public/IUserManager.php#182
Returns:int
Since:11.0.0
public OCP\IUserManager::countSeenUsers()
returns how many users have logged in once
Source:lib/public/IUserManager.php#190
Returns:int
Since:11.0.0
public OCP\IUserManager::callForSeenUsers($callback)
Source:

lib/public/IUserManager.php#197

Parameters:
  • $callback (Closure)
Since:

11.0.0

public OCP\IUserManager::getByEmail($email)
Source:

lib/public/IUserManager.php#204

Parameters:
  • $email (string)
Returns:

\OCP\IUser[]

Since:

9.1.0