IUserManager
in
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)
Tags
Table of Contents
Constants
- MAX_PASSWORD_LENGTH = 469
Methods
- callForAllUsers() : mixed
- callForSeenUsers() : mixed
- checkPassword() : IUser|false
- Check if the password is valid for the user
- clearBackends() : mixed
- remove all user backends
- countDisabledUsers() : int
- returns how many users have logged in once
- countSeenUsers() : int
- returns how many users have logged in once
- countUsers() : array<string, int>
- Get how many users per backend exist (if supported by backend)
- createUser() : false|IUser
- createUserFromBackend() : IUser|null
- get() : IUser|null
- get a user by user id
- getBackends() : array<string|int, UserInterface>
- Get the active backends
- getByEmail() : array<string|int, IUser>
- returns all users having the provided email set as system email address
- getDisabledUsers() : array<string|int, IUser>
- getDisplayName() : string|null
- Get the display name of a user
- getLastLoggedInUsers() : array<int, string>
- Gets the list of users sorted by lastLogin, from most recent to least recent
- registerBackend() : mixed
- register a user backend
- removeBackend() : mixed
- remove a user backend
- search() : array<string|int, IUser>
- search by user id
- searchDisplayName() : array<string|int, IUser>
- search by displayName
- searchKnownUsersByDisplayName() : array<string|int, IUser>
- Search known users (from phonebook sync) by displayName
- userExists() : bool
- check if a user exists
- validateUserId() : void
Constants
MAX_PASSWORD_LENGTH
public
mixed
MAX_PASSWORD_LENGTH
= 469
Tags
Methods
callForAllUsers()
public
callForAllUsers(Closure $callback[, string $search = '' ]) : mixed
Parameters
- $callback : Closure
- $search : string = ''
Tags
callForSeenUsers()
public
callForSeenUsers(Closure $callback) : mixed
Parameters
- $callback : Closure
Tags
checkPassword()
Check if the password is valid for the user
public
checkPassword(string $loginName, string $password) : IUser|false
Parameters
- $loginName : string
- $password : string
Tags
Return values
IUser|false —the User object on success, false otherwise
clearBackends()
remove all user backends
public
clearBackends() : mixed
Tags
countDisabledUsers()
returns how many users have logged in once
public
countDisabledUsers() : int
Tags
Return values
intcountSeenUsers()
returns how many users have logged in once
public
countSeenUsers() : int
Tags
Return values
intcountUsers()
Get how many users per backend exist (if supported by backend)
public
countUsers() : array<string, int>
Tags
Return values
array<string, int> —an array of backend class name as key and count number as value
createUser()
public
createUser(string $uid, string $password) : false|IUser
Parameters
- $uid : string
- $password : string
Tags
Return values
false|IUser —the created user or false
createUserFromBackend()
public
createUserFromBackend(string $uid, string $password, UserInterface $backend) : IUser|null
Parameters
- $uid : string
- $password : string
- $backend : UserInterface
Tags
Return values
IUser|nullget()
get a user by user id
public
get(string $uid) : IUser|null
Parameters
- $uid : string
Tags
Return values
IUser|null —Either the user or null if the specified user does not exist
getBackends()
Get the active backends
public
getBackends() : array<string|int, UserInterface>
Tags
Return values
array<string|int, UserInterface>getByEmail()
returns all users having the provided email set as system email address
public
getByEmail(string $email) : array<string|int, IUser>
Parameters
- $email : string
Tags
Return values
array<string|int, IUser>getDisabledUsers()
public
getDisabledUsers([int|null $limit = null ][, int $offset = 0 ][, string $search = '' ]) : array<string|int, IUser>
Parameters
- $limit : int|null = null
- $offset : int = 0
- $search : string = ''
Tags
Return values
array<string|int, IUser>getDisplayName()
Get the display name of a user
public
getDisplayName(string $uid) : string|null
Parameters
- $uid : string
Tags
Return values
string|nullgetLastLoggedInUsers()
Gets the list of users sorted by lastLogin, from most recent to least recent
public
getLastLoggedInUsers([int|null $limit = null ][, int $offset = 0 ][, string $search = '' ]) : array<int, string>
Parameters
- $limit : int|null = null
-
how many records to fetch
- $offset : int = 0
-
from which offset to fetch
- $search : string = ''
-
search users based on search params
Tags
Return values
array<int, string> —list of user IDs
registerBackend()
register a user backend
public
registerBackend(UserInterface $backend) : mixed
Parameters
- $backend : UserInterface
Tags
removeBackend()
remove a user backend
public
removeBackend(UserInterface $backend) : mixed
Parameters
- $backend : UserInterface
Tags
search()
search by user id
public
search(string $pattern[, int $limit = null ][, int $offset = null ]) : array<string|int, IUser>
Parameters
- $pattern : string
- $limit : int = null
- $offset : int = null
Tags
Return values
array<string|int, IUser>searchDisplayName()
search by displayName
public
searchDisplayName(string $pattern[, int $limit = null ][, int $offset = null ]) : array<string|int, IUser>
Parameters
- $pattern : string
- $limit : int = null
- $offset : int = null
Tags
Return values
array<string|int, IUser>searchKnownUsersByDisplayName()
Search known users (from phonebook sync) by displayName
public
searchKnownUsersByDisplayName(string $searcher, string $pattern[, int|null $limit = null ][, int|null $offset = null ]) : array<string|int, IUser>
Parameters
- $searcher : string
- $pattern : string
- $limit : int|null = null
- $offset : int|null = null
Tags
Return values
array<string|int, IUser>userExists()
check if a user exists
public
userExists(string $uid) : bool
Parameters
- $uid : string
Tags
Return values
boolvalidateUserId()
public
validateUserId(string $uid[, bool $checkDataDirectory = false ]) : void
Parameters
- $uid : string
-
The user ID to validate
- $checkDataDirectory : bool = false
-
Whether it should be checked if files for the ID exist inside the data directory