IUser
in
Interface IUser
Tags
Table of Contents
Methods
- canChangeAvatar() : bool
- check if the backend allows the user to change their avatar on Personal page
- canChangeDisplayName() : bool
- check if the backend supports changing display names
- canChangePassword() : bool
- check if the backend supports changing passwords
- delete() : bool
- Delete the user
- getAvatarImage() : IImage|null
- get the avatar image if it exists
- getBackend() : UserInterface|null
- Get the backend for the current user object
- getBackendClassName() : string
- Get the name of the backend class the user is connected with
- getCloudId() : string
- get the federation cloud id
- getDisplayName() : string
- get the display name for the user, if no specific display name is set it will fallback to the user id
- getEMailAddress() : string|null
- get the user's email address
- getHome() : string
- get the users home folder to mount
- getLastLogin() : int
- returns the timestamp of the user's last login or 0 if the user did never login
- getManagerUids() : array<string|int, string>
- Get the user's manager UIDs
- getPasswordHash() : string|null
- Get the password hash of the user
- getPrimaryEMailAddress() : string|null
- get the user's preferred email address
- getQuota() : string
- get the users' quota in human readable form. If a specific quota is not set for the user, the default value is returned. If a default setting was not set otherwise, it is return as 'none', i.e. quota is not limited.
- getSystemEMailAddress() : string|null
- get the user's system email address
- getUID() : string
- get the user id
- isEnabled() : bool
- check if the user is enabled
- setDisplayName() : bool
- set the display name for the user
- setEMailAddress() : void
- set the email address of the user
- setEnabled() : mixed
- set the enabled status for the user
- setManagerUids() : void
- Set the user's manager UIDs
- setPassword() : bool
- Set the password of the user
- setPasswordHash() : bool
- Set the password hash of the user
- setPrimaryEMailAddress() : void
- Set the primary email address of the user.
- setQuota() : void
- set the users' quota
- setSystemEMailAddress() : void
- Set the system email address of the user
- updateLastLoginTimestamp() : mixed
- updates the timestamp of the most recent login of this user
Methods
canChangeAvatar()
check if the backend allows the user to change their avatar on Personal page
public
canChangeAvatar() : bool
Tags
Return values
boolcanChangeDisplayName()
check if the backend supports changing display names
public
canChangeDisplayName() : bool
Tags
Return values
boolcanChangePassword()
check if the backend supports changing passwords
public
canChangePassword() : bool
Tags
Return values
booldelete()
Delete the user
public
delete() : bool
Tags
Return values
boolgetAvatarImage()
get the avatar image if it exists
public
getAvatarImage(int $size) : IImage|null
Parameters
- $size : int
Tags
Return values
IImage|nullgetBackend()
Get the backend for the current user object
public
getBackend() : UserInterface|null
Tags
Return values
UserInterface|nullgetBackendClassName()
Get the name of the backend class the user is connected with
public
getBackendClassName() : string
Tags
Return values
stringgetCloudId()
get the federation cloud id
public
getCloudId() : string
Tags
Return values
stringgetDisplayName()
get the display name for the user, if no specific display name is set it will fallback to the user id
public
getDisplayName() : string
Tags
Return values
stringgetEMailAddress()
get the user's email address
public
getEMailAddress() : string|null
Tags
Return values
string|nullgetHome()
get the users home folder to mount
public
getHome() : string
Tags
Return values
stringgetLastLogin()
returns the timestamp of the user's last login or 0 if the user did never login
public
getLastLogin() : int
Tags
Return values
intgetManagerUids()
Get the user's manager UIDs
public
getManagerUids() : array<string|int, string>
Tags
Return values
array<string|int, string>getPasswordHash()
Get the password hash of the user
public
getPasswordHash() : string|null
Tags
Return values
string|null —the password hash hashed by \OCP\Security\IHasher::hash()
getPrimaryEMailAddress()
get the user's preferred email address
public
getPrimaryEMailAddress() : string|null
The primary mail address may be set be the user to specify a different email address where mails by Nextcloud are sent to. It is not necessarily set.
Use this getter only when the primary address is needed. For picking the proper address to e.g. send a mail to, use getEMailAddress().
Tags
Return values
string|nullgetQuota()
get the users' quota in human readable form. If a specific quota is not set for the user, the default value is returned. If a default setting was not set otherwise, it is return as 'none', i.e. quota is not limited.
public
getQuota() : string
Tags
Return values
stringgetSystemEMailAddress()
get the user's system email address
public
getSystemEMailAddress() : string|null
The system mail address may be read only and may be set from different sources like LDAP, SAML or simply the admin.
Use this getter only when the system address is needed. For picking the proper address to e.g. send a mail to, use getEMailAddress().
Tags
Return values
string|nullgetUID()
get the user id
public
getUID() : string
Tags
Return values
stringisEnabled()
check if the user is enabled
public
isEnabled() : bool
Tags
Return values
boolsetDisplayName()
set the display name for the user
public
setDisplayName(string $displayName) : bool
Parameters
- $displayName : string
Tags
Return values
boolsetEMailAddress()
set the email address of the user
public
setEMailAddress(string|null $mailAddress) : void
use setSystemEMailAddress() or setPrimaryEMailAddress()
It is an alias to setSystemEMailAddress()
Parameters
- $mailAddress : string|null
Tags
setEnabled()
set the enabled status for the user
public
setEnabled([bool $enabled = true ]) : mixed
Parameters
- $enabled : bool = true
Tags
setManagerUids()
Set the user's manager UIDs
public
setManagerUids(array<string|int, string> $uids) : void
Parameters
- $uids : array<string|int, string>
-
UIDs of all managers
Tags
setPassword()
Set the password of the user
public
setPassword(string $password[, string $recoveryPassword = null ]) : bool
Parameters
- $password : string
- $recoveryPassword : string = null
-
for the encryption app to reset encryption keys
Tags
Return values
boolsetPasswordHash()
Set the password hash of the user
public
setPasswordHash(string $passwordHash) : bool
Parameters
- $passwordHash : string
-
the password hash hashed by
\OCP\Security\IHasher::hash()
Tags
Return values
boolsetPrimaryEMailAddress()
Set the primary email address of the user.
public
setPrimaryEMailAddress(string $mailAddress) : void
This method should be typically called when the user is changing their own primary address and is not allowed to change their system email.
The mail address provided here must be already registered as an additional mail in the user account and also be verified locally. Also an empty string is allowed to delete this preference.
Parameters
- $mailAddress : string
Tags
setQuota()
set the users' quota
public
setQuota(string $quota) : void
Parameters
- $quota : string
Tags
setSystemEMailAddress()
Set the system email address of the user
public
setSystemEMailAddress(string $mailAddress) : void
This is supposed to be used when the email is set from different sources (i.e. other user backends, admin).
Parameters
- $mailAddress : string
Tags
updateLastLoginTimestamp()
updates the timestamp of the most recent login of this user
public
updateLastLoginTimestamp() : mixed