Class rcmail

Description

Application class of Roundcube Webmail implemented as singleton

Located in /rcmail.php (line 30)


	
			
Variable Summary
Method Summary
 static output exec ($cmd 0, $values 1)
 static rcmail get_instance ()
 static Success imageconvert ($p['in'] $p, $p['out'] 1, $p['size'] 2, $p['type'] 3, $p['-opts'] 4)
 static mixed imageprops (string $filepath)
 static void setcookie (string $name, string $value, [string $exp = 0])
 void add_shutdown_function (callback $function)
 string autoselect_host ()
 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 ([boolean $connect = false])
 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_imap_prop ()
 void set_task (string $task)
 void set_user (rcube_user $user)
 void shutdown ()
 void smtp_init ([boolean $connect = false])
 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 37)

Main tasks.

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

Current action.

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

Stores instance of rcube_config.

  • access: public
rcube_mdb2 $db (line 65)

Instace of database class.

  • access: public
rcube_imap $imap (line 93)

Instance of rcube_imap class.

  • access: public
rcube_mdb2 $memcache (line 72)

Instace of Memcache class.

  • access: public
rcube_template $output (line 100)

Instance of rcube_template class.

  • access: public
rcube_plugin_api $plugins (line 107)

Instance of rcube_plugin_api.

  • access: public
rcube_session $session (line 79)

Instace of rcube_session class.

  • access: public
rcube_smtp $smtp (line 86)

Instance of rcube_smtp class.

  • access: public
string $task (line 114)

Current task.

  • access: public
rcube_user $user (line 58)

Stores rcube_user instance.

  • access: public
Methods
static exec (line 1532)

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 136)

This implements the 'singleton' design pattern

rcmail get_instance ()
static imageconvert (line 1499)

Convert an image to a given size and type using imagemagick (ensures input is an image)

  • return: of convert as true/false
  • access: public
Success imageconvert ($p['in'] $p, $p['out'] 1, $p['size'] 2, $p['type'] 3, $p['-opts'] 4)
  • $p['out'] 1: Output filename (mandatory)
  • $p['size'] 2: Width x height of resulting image, e.g. "160x60"
  • $p['type'] 3: Output file type, e.g. "jpg"
  • $p['-opts'] 4: Custom command line options to ImageMagick convert
  • $p['in'] $p: Input filename (mandatory)
static imageprops (line 1470)

Use imagemagick or GD lib to read image properties

  • return: Hash array with image props like type, width, height or False on error
  • access: public
mixed imageprops (string $filepath)
  • string $filepath: Absolute file path
static setcookie (line 1577)

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 1256)

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 933)

Auto-select IMAP host based on the posted login information

  • return: Selected IMAP host
  • access: public
string autoselect_host ()
check_request (line 1282)

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 1370)

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 1321)

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 980)

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 1607)

Returns current action filename

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

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 470)

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 388)

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 311)

Get the current database connection

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

Get global handle for memcache access

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

Generate a unique token to be used in a form request

  • return: The request token
  • access: public
string get_request_token ()
imap_connect (line 653)

Connect to IMAP server with stored session data

  • return: True on success, false on error
  • access: public
bool imap_connect ()
imap_init (line 590)

Create global IMAP object and connect to server

  • todo: Remove global $IMAP
  • access: public
void imap_init ([boolean $connect = false])
  • boolean $connect: True if connection should be established
json_init (line 561)

Create an output object for JSON responses

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

Destroy session data and remove cookie

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

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

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

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 1089)

Load a localization package

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

Perfom login to the IMAP 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: IMAP user name
  • string $pass: IMAP password
  • string $host: IMAP host
logout_actions (line 1175)

Do server side actions on logout

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

Callback for memcache failure

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

Registers action aliases for current task

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

Configure session object internals

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

Create session object and start the session.

  • access: public
void session_init ()
set_imap_prop (line 912)

Set root dir and last stored mailbox

This must be done AFTER connecting to the server!

  • access: public
void set_imap_prop ()
set_task (line 217)

Setter for application task

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

Setter for system user object

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

Function to be executed in script shutdown

Registered with register_shutdown_function()

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

Create SMTP object and connect to server

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

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 1442)

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 Tue, 04 Oct 2011 22:55:23 +0200 by phpDocumentor 1.4.3