rcube_user

Class representing a system user

package

Framework

subpackage

Core

Methods

Object constructor

__construct(int $id = null, array $sql_arr = null) 

Arguments

$id

int

User id

$sql_arr

array

SQL result set

Build a user name string (as e-mail address)

get_username(string $part = null) : string

Arguments

$part

string

Username part (empty or 'local' or 'domain', 'mail')

Response

string

Full user name or its part

Get the preferences saved for this user

get_prefs() : array

Response

array

Hash array with prefs

Write the given user prefs to the user's record

save_prefs(array $a_user_prefs) : boolean

Arguments

$a_user_prefs

array

User prefs to save

Response

boolean

True on success, False on failure

Generate a unique hash to identify this user which

get_hash() 

Get default identity of this user

get_identity(int $id = null) : array

Arguments

$id

int

Identity ID. If empty, the default identity is returned

Response

array

Hash array with all cols of the identity record

Return a list of all identities linked with this user

list_identities(string $sql_add = '', bool $formatted = false) : array

Arguments

$sql_add

string

Optional WHERE clauses

$formatted

bool

Format identity email and name

Response

array

List of identities

Update a specific identity record

update_identity(int $iid, array $data) : boolean

Arguments

$iid

int

Identity ID

$data

array

Hash array with col->value pairs to save

Response

boolean

True if saved successfully, false if nothing changed

Create a new identity record linked with this user

insert_identity(array $data) : int

Arguments

$data

array

Hash array with col->value pairs to save

Response

int

The inserted identity ID or false on error

Mark the given identity as deleted

delete_identity(int $iid) : boolean

Arguments

$iid

int

Identity ID

Response

boolean

True if deleted successfully, false if nothing changed

Make this identity the default one for this user

set_default(int $iid) 

Arguments

$iid

int

The identity ID

Update user's last_login timestamp

touch() 

Clear the saved object state

reset() 

Find a user record matching the given name and host

query(string $user, string $host) : \rcube_user
static

Arguments

$user

string

IMAP user name

$host

string

IMAP host name

Response

\rcube_user

New user instance

Create a new user record and return a rcube_user instance

create(string $user, string $host) : \rcube_user
static

Arguments

$user

string

IMAP user name

$host

string

IMAP host

Response

\rcube_user

New user instance

Resolve username using a virtuser plugins

email2user(string $email) : string
static

Arguments

$email

string

E-mail address to resolve

Response

string

Resolved IMAP username

Resolve e-mail address from virtuser plugins

user2email(string $user, boolean $first = true, boolean $extended = false) : mixed
static

Arguments

$user

string

User name

$first

boolean

If true returns first found entry

$extended

boolean

If true returns email as array (email and name for identity)

Response

mixed

Resolved e-mail address string or array of strings

Return a list of saved searches linked with this user

list_searches(int $type) : array

Arguments

$type

int

Search type

Response

array

List of saved searches indexed by search ID

Constants

SEARCH_ADDRESSBOOK

SEARCH_ADDRESSBOOK

SEARCH_MAIL

SEARCH_MAIL

Properties

ID

ID : 

data

data : 

language

language : 

Holds database connection.

db : \rcube_db
var

Type(s)

\rcube_db

Framework object.

rc : \rcube
var

Type(s)

\rcube

Internal identities cache

identities : array
var

Type(s)

array