\midcom_core_account

Helper class for account management

Summary

Methods
Properties
Constants
__construct()
save()
delete()
set_username()
set_password()
set_usertype()
get_password()
get_username()
get_usertype()
add_username_constraint()
add_username_order()
is_admin()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_create_user()
_update()
_get_user()
_is_username_unique()
$_person
$_user
$_old_username
N/A

Properties

$_person

$_person : 

The person the account belongs to

Type

$_user

$_user : 

The current account

Type

$_old_username

$_old_username : string

Change tracking variable

Type

string

Methods

__construct()

__construct(  $person) 

Parameters

$person

save()

save() 

delete()

delete() : boolean

Deletes the current user account.

This will cleanup all information associated with the user that is managed by the core (like privilege records).

This call requires the delete privilege on the person object, this is enforced using require_do.

Returns

boolean —

Indicating success.

set_username()

set_username(  $username) 

Parameters

$username

set_password()

set_password(string  $password, boolean  $encode = true) 

Set the account's password

Parameters

string $password

The password to set

boolean $encode

Should the password be encoded according to the configured auth type

set_usertype()

set_usertype(  $type) 

Parameters

$type

get_password()

get_password() 

get_username()

get_username() 

get_usertype()

get_usertype() 

add_username_constraint()

add_username_constraint(\midcom_core_query  $query, string  $operator, string  $value) 

Modify a query instance for searching by username

Parameters

\midcom_core_query $query

The QB or MC instance to work on

string $operator

The operator for the username constraint

string $value

The value for the username constraint

add_username_order()

add_username_order(\midcom_core_query  $query, string  $direction) 

Add username order to a query instance

Parameters

\midcom_core_query $query

The QB or MC instance to work on

string $direction

The value for the username constraint

is_admin()

is_admin() 

_create_user()

_create_user() 

_update()

_update() 

_get_user()

_get_user() 

_is_username_unique()

_is_username_unique()