A RoundCube API via direct database manipulation.

category OSS
package OSS_API
copyright Copyright (c) 2007 - 2013, Open Source Solutions Limited, Dublin, Ireland
license New BSD License

 Methods

Constructor - creates a new DBAL connection.

__construct(array $dbparams) : void

Parameters

$dbparams

array

Creates identity for user.

addIdentity(array $user, string $email, array $identity) : bool

$identity array sturcture: [ 'replay_to' => 'replay_to', 'bcc' => 'bcc', 'name' => 'name', 'organization' => 'organization', 'signature' => 'signature', 'html_signature' => 'html_signature' ]

access public

Parameters

$user

array

User array loaded form OSS_API_RoundCube

$email

string

Email address

$identity

array

Returns

bool

Creates RoundCube user, and also creates identity if $identity array is passed.

addUser(string $username, string $mail_host, array $preferences, array $identity) : bool

NOTICE: If $identity array is passed it must contain $identity['mail'].

access public
see \global\addIdentity()

Parameters

$username

string

Users username

$mail_host

string

IMAP addres where email is stored

$preferences

array

Users preferences such as davical details.

$identity

array

Users identity details.

Exceptions

\Identity mail is not set.

Returns

bool

Implementation of RoundCube's create_iv function.

createIV(int $size) : string
Static

Based on source code from the program/include/rcmail.php rcmail::create_iv() function.

Parameters

$size

int

The size of the initialisation vector

Returns

stringThe initialisation vector

Implementation of RoundCube's decryption function.

decrypt(string $cipher, string $key, string $base64) : string
Static

Based on source code from the program/include/rcmail.php rcmail::decrypt() function.

Parameters

$cipher

string

The ciphertext string to decrypt

$key

string

The encryption key

$base64

string

Indicates if the ciphertext is a base64 encoded string

Returns

stringThe cleartext

Implementation of RoundCube's encryption function.

encrypt(string $clear, string $key, string $base64) : string
Static

Based on source code from the program/include/rcmail.php rcmail::encrypt() function.

Parameters

$clear

string

The cleartext string to encrypt

$key

string

The encryption key

$base64

string

Return the ciphertext as a base64 encoded string

Returns

stringThe ciphertext

Get all users registered in the RoundCube database as an array.

getAllUsers() : array
access public

Returns

arrayAll users registered in the database

Get users data from the RoundCube database as an array.

getUser(\strint $username) : array | bool
access public

Parameters

$username

\strint

Users username

Returns

arraybool

Sets language

setLanguage(string $lang) : \OSS_API_RoundCube

By default is en_GB

fluent This method is part of a fluent interface and will return the same instance

Parameters

$lang

string

Users preference language

Returns

\OSS_API_RoundCubefor fluent interface

Sets standard

setStandard(int $standard) : \OSS_API_RoundCube

By default is 1

fluent This method is part of a fluent interface and will return the same instance

Parameters

$standard

int

Identity standard

Returns

\OSS_API_RoundCubefor fluent interface

Creates identity for user.

updateIdentity(array $user, array $identity) : bool

$identity array sturcture: [ 'email' => email, 'replay_to' => 'replay_to', 'bcc' => 'bcc', 'name' => 'name', 'organization' => 'organization', 'signature' => 'signature', 'html_signature' => 'html_signature' ]

access public

Parameters

$user

array

User array loaded form OSS_API_RoundCube

$identity

array

Returns

bool

Updates RoundCube users data, and also updates identity data if $identity array is passed.

updateUser(string $username, string $mail_host, array $preferences, array $identity) : bool
access public

Parameters

$username

string

Users username

$mail_host

string

IMAP addres where email is stored

$preferences

array

Users preferences such as davical details.

$identity

array

Users identity details.

Returns

bool

 Properties

 

Stores users preference default language

$_language : string
 

Stores users identity standard default value

$_standard : int