Class rcmail

Description

Application class of Roundcube Webmail implemented as singleton

Located in /rcmail.php (line 33)


	
			
Variable Summary
Method Summary
 static output exec ($cmd 0, $values 1)
 static rcmail get_instance ()
 static void setcookie (string $name, string $value, [string $exp = 0])
 void add_shutdown_function (callback $function)
 string autoselect_host ()
 void cache_gc ()
 boolean check_request ([int $mode = RCUBE_INPUT_POST])
 string decrypt (string $cipher, [string $key = 'des_key'], [boolean $base64 = true])
 string encrypt (string $clear, [string $key = 'des_key'], [boolean $base64 = true])
 string gettext (mixed $attrib, [string $domain = null])
 void get_action_file (array $map)
 rcube_contacts get_address_book (string $id, [boolean $writeable = false])
 array get_address_sources ([boolean $writeable = false])
 rcube_cache get_cache (string $name, [string $type = 'db'], [int $ttl = 0], [bool $packed = true])
 object Memcache get_memcache ()
 string get_request_token ()
 bool imap_connect ()
 void imap_init ()
 void kill_session ()
 array list_languages ()
 rcube_template load_gui ([boolean $framed = false])
 void load_language ([string $lang = null], [ $add = array()])
 boolean login (string $username, string $pass, [string $host = NULL])
 void logout_actions ()
 void memcache_failure ( $host,  $port)
 void register_action_map (array $map)
 void session_init ()
 void set_task (string $task)
 void set_user (rcube_user $user)
 void shutdown ()
 void smtp_init ([boolean $connect = false])
 bool storage_connect ()
 void storage_init ()
 boolean text_exists (string $name, [string $domain = null], [ &$ref_domain = null], string $ref_domain)
 string url (mixed $p)
Variables
static array $main_tasks = array('mail','settings','addressbook','login','logout','utils','dummy') (line 40)

Main tasks.

  • access: public
string $action = '' (line 124)

Current action.

  • access: public
mixed $comm_path = './' (line 125)
  • access: public
rcube_config $config (line 54)

Stores instance of rcube_config.

  • access: public
rcube_mdb2 $db (line 68)

Instace of database class.

  • access: public
rcube_mdb2 $memcache (line 75)

Instace of Memcache class.

  • access: public
rcube_template $output (line 103)

Instance of rcube_template class.

  • access: public
rcube_plugin_api $plugins (line 110)

Instance of rcube_plugin_api.

  • access: public
rcube_session $session (line 82)

Instace of rcube_session class.

  • access: public
rcube_smtp $smtp (line 89)

Instance of rcube_smtp class.

  • access: public
rcube_storage $storage (line 96)

Instance of rcube_storage class.

  • access: public
string $task (line 117)

Current task.

  • access: public
rcube_user $user (line 61)

Stores rcube_user instance.

  • access: public
Methods
static exec (line 1546)

Construct shell command, execute it and return output as string.

Keywords {keyword} are replaced with arguments

  • return: of command. shell errors not detectable
  • access: public
output exec ($cmd 0, $values 1)
  • $cmd 0: Format string with {keywords} to be replaced
  • $values 1: (zero, one or more arrays can be passed)
static get_instance (line 140)

This implements the 'singleton' design pattern

  • return: The one and only instance
rcmail get_instance ()
static setcookie (line 1591)

Helper method to set a cookie with the current path and host settings

  • access: public
void setcookie (string $name, string $value, [string $exp = 0])
  • string $name: Cookie name
  • string $value: Cookie value
  • string $exp: Expiration time
add_shutdown_function (line 1318)

Registers shutdown function to be executed on shutdown.

The functions will be executed before destroying any objects like smtp, imap, session, etc.

  • access: public
void add_shutdown_function (callback $function)
  • callback $function: Function callback
autoselect_host (line 1013)

Auto-select IMAP host based on the posted login information

  • return: Selected IMAP host
  • access: public
string autoselect_host ()
cache_gc (line 1328)

Garbage collector for cache entries.

Set flag to expunge caches on shutdown

void cache_gc ()
check_request (line 1356)

Check if the current request contains a valid token

  • return: True if request token is valid false if not
  • access: public
boolean check_request ([int $mode = RCUBE_INPUT_POST])
  • int $mode: Request method
decrypt (line 1444)

Decrypt 3DES-encrypted string

  • return: decrypted text
  • access: public
string decrypt (string $cipher, [string $key = 'des_key'], [boolean $base64 = true])
  • string $cipher: encrypted text
  • string $key: encryption key to retrieve from the configuration, defaults to 'des_key'
  • boolean $base64: whether or not input is base64-encoded
encrypt (line 1395)

Encrypt using 3DES

  • return: encrypted text
  • access: public
string encrypt (string $clear, [string $key = 'des_key'], [boolean $base64 = true])
  • string $clear: clear text input
  • string $key: encryption key to retrieve from the configuration, defaults to 'des_key'
  • boolean $base64: whether or not to base64_encode() the result before returning
gettext (line 1065)

Get localized text in the desired language

  • return: Localized text
  • access: public
string gettext (mixed $attrib, [string $domain = null])
  • mixed $attrib: Named parameters array or label name
  • string $domain: Label domain (plugin) name
get_action_file (line 1621)

Returns current action filename

  • access: public
void get_action_file (array $map)
  • array $map: Alias-to-filename hash array
get_address_book (line 407)

Return instance of the internal address book class

  • return: Address book object
  • access: public
rcube_contacts get_address_book (string $id, [boolean $writeable = false])
  • string $id: Address book identifier
  • boolean $writeable: True if the address book needs to be writeable
get_address_sources (line 474)

Return address books list

  • return: Address books array
  • access: public
array get_address_sources ([boolean $writeable = false])
  • boolean $writeable: True if the address book needs to be writeable
get_cache (line 389)

Initialize and get cache object

  • return: Cache object
  • access: public
rcube_cache get_cache (string $name, [string $type = 'db'], [int $ttl = 0], [bool $packed = true])
  • string $name: Cache identifier
  • string $type: Cache type ('db', 'apc' or 'memcache')
  • int $ttl: Expiration time for cache items in seconds
  • bool $packed: Enables/disables data serialization
get_dbh (line 312)

Get the current database connection

  • return: Database connection object
  • access: public
rcube_mdb2 get_dbh ()
get_memcache (line 331)

Get global handle for memcache access

  • access: public
object Memcache get_memcache ()
get_request_token (line 1341)

Generate a unique token to be used in a form request

  • return: The request token
  • access: public
string get_request_token ()
get_storage (line 598)

Initialize and get storage object

  • return: Storage object
  • access: public
rcube_storage get_storage ()
imap_connect (line 615)

Connect to the IMAP server with stored session data.

  • return: True on success, False on error
  • deprecated:
  • access: public
bool imap_connect ()
imap_init (line 626)

Initialize IMAP object.

  • deprecated:
  • access: public
void imap_init ()
json_init (line 570)

Create an output object for JSON responses

  • return: Reference to JSON output object
  • access: public
rcube_json_output json_init ()
kill_session (line 1222)

Destroy session data and remove cookie

  • access: public
void kill_session ()
list_languages (line 1196)

Read directory program/localization and return a list of available languages

  • return: List of available localizations
  • access: public
array list_languages ()
load_gui (line 537)

Init output object for GUI and add common scripts.

This will instantiate a rcmail_template object and set environment vars according to the current session and configuration

  • return: Reference to HTML output object
  • access: public
rcube_template load_gui ([boolean $framed = false])
  • boolean $framed: True if this request is loaded in a (i)frame
load_language (line 1149)

Load a localization package

  • access: public
void load_language ([string $lang = null], [ $add = array()])
  • string $lang: Language ID
  • $add
login (line 820)

Perfom login to the mail server and to the webmail service.

This will also create a new user entry if auto_create_user is configured.

  • return: True on success, False on failure
boolean login (string $username, string $pass, [string $host = NULL])
  • string $username: Mail storage (IMAP) user name
  • string $pass: Mail storage (IMAP) password
  • string $host: Mail storage (IMAP) host
logout_actions (line 1235)

Do server side actions on logout

  • access: public
void logout_actions ()
memcache_failure (line 364)

Callback for memcache failure

  • access: public
void memcache_failure ( $host,  $port)
  • $host
  • $port
register_action_map (line 1607)

Registers action aliases for current task

  • access: public
void register_action_map (array $map)
  • array $map: Alias-to-filename hash array
session_configure (line 789)

Configure session object internals

  • access: public
void session_configure ()
session_init (line 741)

Create session object and start the session.

  • access: public
void session_init ()
set_task (line 219)

Setter for application task

  • access: public
void set_task (string $task)
  • string $task: Task to set
set_user (line 241)

Setter for system user object

  • access: public
void set_user (rcube_user $user)
shutdown (line 1266)

Function to be executed in script shutdown

Registered with register_shutdown_function()

  • access: public
void shutdown ()
smtp_init (line 584)

Create SMTP object and connect to server

  • access: public
void smtp_init ([boolean $connect = false])
  • boolean $connect: True if connection should be established
storage_connect (line 714)

Connect to the mail storage server with stored session data

  • return: True on success, False on error
  • access: public
bool storage_connect ()
storage_init (line 635)

Initialize storage object

  • access: public
void storage_init ()
text_exists (line 1116)

Check if the given text label exists

  • return: True if text exists (either in the current language or in en_US)
  • access: public
boolean text_exists (string $name, [string $domain = null], [ &$ref_domain = null], string $ref_domain)
  • string $name: Label name
  • string $domain: Label domain (plugin) name or '*' for all domains
  • string $ref_domain: Sets domain name if label is found
  • &$ref_domain
url (line 1516)

Build a valid URL to this instance of Roundcube

  • return: Valid application URL
  • access: public
string url (mixed $p)
  • mixed $p: Either a string with the action or url parameters as key-value pairs

Documentation generated on Wed, 23 May 2012 16:40:47 +0200 by phpDocumentor 1.4.4