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#50

Methods

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

lib/public/IUserManager.php#57

Parameters:
Since:

8.0.0

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

lib/public/IUserManager.php#72

Parameters:
Since:

8.0.0

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

lib/public/IUserManager.php#87

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#96

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#106

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#117

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#128

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

\OCP\IUser[]

Since:

8.0.0

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

lib/public/IUserManager.php#137

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#147

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#155
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#162

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#170
Returns:int
Since:11.0.0
public OCP\IUserManager::countSeenUsers()
returns how many users have logged in once
Source:lib/public/IUserManager.php#178
Returns:int
Since:11.0.0
public OCP\IUserManager::callForSeenUsers($callback)
Source:

lib/public/IUserManager.php#184

Parameters:
  • $callback (Closure)
Since:

11.0.0

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

lib/public/IUserManager.php#191

Parameters:
  • $email (string)
Returns:

\OCP\IUser[]

Since:

9.1.0