User

class OC\User\User
Source:lib/private/User/User.php#48
Implements:OCP\IUser

Properties

Methods

public OC\User\User::__construct($uid, $backend, $dispatcher, $emitter=null, $config=null, $urlGenerator=null)
Source:lib/private/User/User.php#81
public OC\User\User::getUID()
get the user id
Source:lib/private/User/User.php#104
Returns:string
public OC\User\User::getDisplayName()
get the display name for the user, if no specific display name is set it will fallback to the user id
Source:lib/private/User/User.php#113
Returns:string
public OC\User\User::setDisplayName($displayName)
set the displayname for the user
Source:

lib/private/User/User.php#139

Parameters:
  • $displayName (string)
Returns:

bool

public OC\User\User::setEMailAddress($mailAddress)
set the email address of the user
Source:

lib/private/User/User.php#160

Parameters:
  • $mailAddress (string | null)
Returns:

void

Since:

9.0.0

public OC\User\User::getLastLogin()
returns the timestamp of the user’s last login or 0 if the user did never
login
Source:lib/private/User/User.php#178
Returns:int
public OC\User\User::updateLastLoginTimestamp()
updates the timestamp of the most recent login of this user
Source:lib/private/User/User.php#185
public OC\User\User::delete()
Delete the user
Source:lib/private/User/User.php#199
Returns:bool
public OC\User\User::setPassword($password, $recoveryPassword=null)
Set the password of the user
Source:

lib/private/User/User.php#260

Parameters:
  • $password (string)
  • $recoveryPassword (string) for the encryption app to reset encryption keys
Returns:

bool

public OC\User\User::getHome()
get the users home folder to mount
Source:lib/private/User/User.php#288
Returns:string
public OC\User\User::getBackendClassName()
Get the name of the backend class the user is connected with
Source:lib/private/User/User.php#306
Returns:string
public OC\User\User::getBackend()
Source:lib/private/User/User.php#313
public OC\User\User::canChangeAvatar()
check if the backend allows the user to change his avatar on Personal page
Source:lib/private/User/User.php#322
Returns:bool
public OC\User\User::canChangePassword()
check if the backend supports changing passwords
Source:lib/private/User/User.php#334
Returns:bool
public OC\User\User::canChangeDisplayName()
check if the backend supports changing display names
Source:lib/private/User/User.php#343
Returns:bool
public OC\User\User::isEnabled()
check if the user is enabled
Source:lib/private/User/User.php#355
Returns:bool
public OC\User\User::setEnabled($enabled=true)
set the enabled status for the user
Source:

lib/private/User/User.php#364

Parameters:
  • $enabled (bool)
public OC\User\User::getEMailAddress()
get the users email address
Source:lib/private/User/User.php#380
Returns:string | null
Since:9.0.0
public OC\User\User::getQuota()
get the users’ quota
Source:lib/private/User/User.php#390
Returns:string
Since:9.0.0
public OC\User\User::setQuota($quota)
set the users’ quota
Source:

lib/private/User/User.php#405

Parameters:
  • $quota (string)
Returns:

void

Since:

9.0.0

public OC\User\User::getAvatarImage($size)
get the avatar image if it exists
Source:

lib/private/User/User.php#424

Parameters:
  • $size (int)
Returns:

\OCP\IImage | null

Since:

9.0.0

public OC\User\User::getCloudId()
get the federation cloud id
Source:lib/private/User/User.php#445
Returns:string
Since:9.0.0
public OC\User\User::triggerChange($feature, $value=null, $oldValue=null)
Source:lib/private/User/User.php#466