User

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

Properties

Methods

public OC\User\User::__construct($uid, $backend, $emitter=null, $config=null, $urlGenerator=null)
Source:

lib/private/User/User.php#84

Parameters:
public OC\User\User::getUID()
get the user id
Source:lib/private/User/User.php#106
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#115
Returns:string
public OC\User\User::setDisplayName($displayName)
set the displayname for the user
Source:

lib/private/User/User.php#141

Parameters:
  • $displayName (string)
Returns:

bool

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

lib/private/User/User.php#162

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#180
Returns:int
public OC\User\User::updateLastLoginTimestamp()
updates the timestamp of the most recent login of this user
Source:lib/private/User/User.php#187
public OC\User\User::delete()
Delete the user
Source:lib/private/User/User.php#201
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#280
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#298
Returns:string
public OC\User\User::getBackend()
Source:lib/private/User/User.php#305
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#314
Returns:bool
public OC\User\User::canChangePassword()
check if the backend supports changing passwords
Source:lib/private/User/User.php#326
Returns:bool
public OC\User\User::canChangeDisplayName()
check if the backend supports changing display names
Source:lib/private/User/User.php#335
Returns:bool
public OC\User\User::isEnabled()
check if the user is enabled
Source:lib/private/User/User.php#347
Returns:bool
public OC\User\User::setEnabled($enabled=true)
set the enabled status for the user
Source:

lib/private/User/User.php#356

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

lib/private/User/User.php#396

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

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#436
Returns:string
Since:9.0.0
public OC\User\User::triggerChange($feature, $value=null, $oldValue=null)
Source:lib/private/User/User.php#457