\apex\usersUser

Class to handle all apsects of an individual user account.

Summary

Methods
Properties
Constants
__construct()
create()
add_note()
update_status()
update_group()
update_sec_auth_hash()
load()
get_extra()
get_id()
update_profile()
delete()
change_password()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
format_profile()
$userid
$profile
$extra
N/A

Properties

$userid

$userid :

Type

$profile

$profile :

Type

$extra

$extra :

Type

Methods

__construct()

__construct(integer  $id)

Constructor

Parameters

integer $id

Optional ID# of the user we're managing.

create()

create()

Creates a new user from POSTed information

add_note()

add_note(string  $note): boolean

Add note to user's profile.

Parameters

string $note

The contents of the note to add.

Returns

boolean —

Whether or not the operation was successful.

update_status()

update_status(string  $status,string  $note = '')

Change user status

Parameters

string $status

The status to change the user to.

string $note

Optional note

update_group()

update_group(integer  $group_id,string  $note = '')

Update user group

Parameters

integer $group_id

The ID# of the group to change the user to.

string $note

Optional note.

update_sec_auth_hash()

update_sec_auth_hash(string  $sec_hash)

Update secondary auth hash

Parameters

string $sec_hash

The secondary auth hash to update the user's profile with.

load()

load(boolean  $load_full_profile = false,boolean  $for_display = false)

Load user profile

Parameters

boolean $load_full_profile

Whether or not to load the full profile, including extra profile fields.

boolean $for_display

Whether or not to format the profile variables for display within web browser.

get_extra()

get_extra(string  $package = 'users'): mixed

Get extra profile.

Parameters

string $package

The package alias to retrieve extra information for. Defaults to 'users'

Returns

mixed —

The extra profile info retrieved from that package.

get_id()

get_id(): integer

Return the ID# of the user

Returns

integer —

The unique user ID#

update_profile()

update_profile()

Update user profile from POSTed information

delete()

delete(string  $note = '')

Delete the user

Parameters

string $note

Optional note

change_password()

change_password(string  $old_password,string  $new_password)

Change password

Parameters

string $old_password

The old password of the user.

string $new_password

The new password of the user.

format_profile()

format_profile(): array

Format a profile for display within web browser.

Returns

array —

The formatted profile.