Nextcloud PHP API (master)

IProfileManager

Tags
since
28.0.0

Table of Contents

Constants

DEFAULT_PROPERTY_VISIBILITY  = [\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS => self::VISIBILITY_SHOW_USERS_ONLY, \OCP\Accounts\IAccountManager::PROPERTY_AVATAR => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_HEADLINE => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_ORGANISATION => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_ROLE => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_EMAIL => self::VISIBILITY_SHOW_USERS_ONLY, \OCP\Accounts\IAccountManager::PROPERTY_PHONE => self::VISIBILITY_SHOW_USERS_ONLY, \OCP\Accounts\IAccountManager::PROPERTY_TWITTER => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_WEBSITE => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_PRONOUNS => self::VISIBILITY_SHOW]
Default account property visibility
DEFAULT_VISIBILITY  = self::VISIBILITY_SHOW_USERS_ONLY
Default visibility
VISIBILITY_HIDE  = 'hide'
Visible to nobody
VISIBILITY_SHOW  = 'show'
Visible to users, guests, and public access
VISIBILITY_SHOW_USERS_ONLY  = 'show_users_only'
Visible to users and guests

Methods

getProfileFields()  : array{userId: string, address?: string|null, biography?: string|null, displayname?: string|null, headline?: string|null, isUserAvatarVisible?: bool, organisation?: string|null, pronouns?: string|null, role?: string|null, actions: list}
Return the profile parameters of the target user that are visible to the visiting user in an associative array
isProfileEnabled()  : bool
If no user is passed as an argument return whether profile is enabled globally in `config.php`
isProfileFieldVisible()  : bool
Return whether the profile parameter of the target user is visible to the visiting user

Constants

DEFAULT_PROPERTY_VISIBILITY

Default account property visibility

public mixed DEFAULT_PROPERTY_VISIBILITY = [\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS => self::VISIBILITY_SHOW_USERS_ONLY, \OCP\Accounts\IAccountManager::PROPERTY_AVATAR => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_DISPLAYNAME => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_HEADLINE => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_ORGANISATION => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_ROLE => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_EMAIL => self::VISIBILITY_SHOW_USERS_ONLY, \OCP\Accounts\IAccountManager::PROPERTY_PHONE => self::VISIBILITY_SHOW_USERS_ONLY, \OCP\Accounts\IAccountManager::PROPERTY_TWITTER => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_WEBSITE => self::VISIBILITY_SHOW, \OCP\Accounts\IAccountManager::PROPERTY_PRONOUNS => self::VISIBILITY_SHOW]
Tags
since
28.0.0

DEFAULT_VISIBILITY

Default visibility

public mixed DEFAULT_VISIBILITY = self::VISIBILITY_SHOW_USERS_ONLY
Tags
since
28.0.0

VISIBILITY_HIDE

Visible to nobody

public mixed VISIBILITY_HIDE = 'hide'
Tags
since
28.0.0

VISIBILITY_SHOW

Visible to users, guests, and public access

public mixed VISIBILITY_SHOW = 'show'
Tags
since
28.0.0

VISIBILITY_SHOW_USERS_ONLY

Visible to users and guests

public mixed VISIBILITY_SHOW_USERS_ONLY = 'show_users_only'
Tags
since
28.0.0

Methods

getProfileFields()

Return the profile parameters of the target user that are visible to the visiting user in an associative array

public getProfileFields(IUser $targetUser, IUser|null $visitingUser) : array{userId: string, address?: string|null, biography?: string|null, displayname?: string|null, headline?: string|null, isUserAvatarVisible?: bool, organisation?: string|null, pronouns?: string|null, role?: string|null, actions: list}
Parameters
$targetUser : IUser
$visitingUser : IUser|null
Tags
since
28.0.0
Return values
array{userId: string, address?: string|null, biography?: string|null, displayname?: string|null, headline?: string|null, isUserAvatarVisible?: bool, organisation?: string|null, pronouns?: string|null, role?: string|null, actions: list}

isProfileEnabled()

If no user is passed as an argument return whether profile is enabled globally in `config.php`

public isProfileEnabled([IUser|null $user = null ]) : bool
Parameters
$user : IUser|null = null
Tags
since
28.0.0
Return values
bool

isProfileFieldVisible()

Return whether the profile parameter of the target user is visible to the visiting user

public isProfileFieldVisible(string $profileField, IUser $targetUser, IUser|null $visitingUser) : bool
Parameters
$profileField : string
$targetUser : IUser
$visitingUser : IUser|null
Tags
since
28.0.0
Return values
bool

        
On this page

Search results