Class rcmail

Description

Application class of Roundcube Webmail implemented as singleton

Located in /include/rcmail.php (line 31)

rcube
   |
   --rcmail
Class Constant Summary
Variable Summary
 static array $main_tasks
 string $action
 mixed $comm_path
 string $task
Method Summary
 static void font_defs ([string $font = null], string|array 1)
 static rcmail get_instance ()
 static void quota_display ( $attrib)
 static string replace_emoticons (string $html)
 static void setcookie ( $name,  $value, [ $exp = 0])
 string autoselect_host ()
 void build_folder_tree ( &$arrFolders,  $folder, [ $delm = '/'], [ $path = ''])
 boolean check_request ([int $mode = rcube_utils::INPUT_POST])
 boolean deliver_message ( &$message, string $from, array $mailto,  &$error, [ &$body_file = null], [array $options = null], object $message, array $error, string $body_file)
 void display_server_error ([string $fallback = null], [array $fallback_args = null], [string $suffix = ''])
 void folder_classname ( $folder_id)
 string folder_list (array $attrib)
 html_select folder_selector ([array $p = array()])
 string format_date (mixed $date, [string $format = null], [bool $convert = true])
 string gen_message_id ()
 void get_action_file (array $map)
 rcube_contacts get_address_book (string $id, [boolean $writeable = false])
 array get_address_sources ([boolean $writeable = false], [boolean $skip_hidden = false])
 string get_request_token ()
 void html_editor ([string $mode = ''])
 void imap_connect ()
 void imap_init ()
 void kill_session ()
 rcube_output load_gui ([boolean $framed = false])
 string localize_foldername (string $name, [bool $with_path = true])
 void localize_folderpath ( $path)
 boolean login (string $username, string $pass, [string $host = null], [bool $cookiecheck = false])
 int login_error ()
 void logout_actions ()
 void log_login ()
 void overwrite_action (string $action)
 void quota_content ([ $attrib = null])
 void register_action_map (array $map)
 void render_folder_tree_html ( &$arrFolders,  &$mbox_name,  &$jslist,  $attrib, [ $nestLevel = 0])
 void render_folder_tree_select ( &$arrFolders,  &$mbox_name,  $maxlength,  &$select, [ $realnames = false], [ $nestLevel = 0], [ $opts = array()])
 void session_init ()
 void set_task (string $task)
 void set_user (rcube_user $user)
 string show_bytes (int $bytes)
 void shutdown ()
 void startup ()
 bool storage_connect ()
 string table_output (array $attrib, mixed $table_data, array $a_show_cols, string $id_col)
 void upload_init ()
 void upload_progress ()
 string url (mixed $p)
 string user_date ()
Variables
static array $main_tasks = array('mail','settings','addressbook','login','logout','utils','dummy') (line 38)

Main tasks.

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

Current action.

  • access: public
mixed $comm_path = './' (line 53)
  • access: public
string $task (line 45)

Current task.

  • access: public

Inherited Variables

Inherited from rcube

rcube::$caches
rcube::$config
rcube::$db
rcube::$expunge_cache
rcube::$instance
rcube::$memcache
rcube::$output
rcube::$plugins
rcube::$session
rcube::$shutdown_functions
rcube::$smtp
rcube::$storage
rcube::$texts
Methods
static font_defs (line 2026)

Returns supported font-family specifications

  • access: public
void font_defs ([string $font = null], string|array 1)
  • string $font: Font name
  • string|array 1: Font-family specification array or string (if $font is used)
static get_instance (line 70)

This implements the 'singleton' design pattern

  • return: The one and only instance
rcmail get_instance ()

Redefinition of:
rcube::get_instance()
This implements the 'singleton' design pattern
static quota_display (line 1739)
  • access: public
void quota_display ( $attrib)
  • $attrib
static replace_emoticons (line 1900)

Replaces TinyMCE's emoticon images with plain-text representation

  • return: HTML content
  • access: public
string replace_emoticons (string $html)
  • string $html: HTML content
static setcookie (line 2109)

**********************************************************************

******** Deprecated methods (to be removed) ********* *********************************************************************

  • access: public
void setcookie ( $name,  $value, [ $exp = 0])
  • $name
  • $value
  • $exp
autocomplete_init (line 1995)

Initializes client-side autocompletion.

  • access: public
void autocomplete_init ()
autoselect_host (line 590)

Auto-select IMAP host based on the posted login information

  • return: Selected IMAP host
  • access: public
string autoselect_host ()
build_folder_tree (line 1469)

Create a hierarchical array of the mailbox list

  • access: public
void build_folder_tree ( &$arrFolders,  $folder, [ $delm = '/'], [ $path = ''])
  • &$arrFolders
  • $folder
  • $delm
  • $path
check_request (line 694)

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_utils::INPUT_POST])
  • int $mode: Request method
deliver_message (line 946)

Send the given message using the configured method.

  • return: Send status.
  • access: public
boolean deliver_message ( &$message, string $from, array $mailto,  &$error, [ &$body_file = null], [array $options = null], object $message, array $error, string $body_file)
  • object $message: Reference to Mail_MIME object
  • string $from: Sender address string
  • array $mailto: Array of recipient address strings
  • array $error: SMTP error array (reference)
  • string $body_file: Location of file with saved message body (reference), used when delay_file_io is enabled
  • array $options: SMTP options (e.g. DSN request)
  • &$message
  • &$error
  • &$body_file
display_server_error (line 1805)

Outputs error message according to server error/response codes

  • access: public
void display_server_error ([string $fallback = null], [array $fallback_args = null], [string $suffix = ''])
  • string $fallback: Fallback message label
  • array $fallback_args: Fallback message label arguments
  • string $suffix: Message label suffix
folder_classname (line 1662)

Return internal name for the given folder if it matches the configured special folders

  • access: public
void folder_classname ( $folder_id)
  • $folder_id
folder_list (line 1345)

Return folders list in HTML

  • return: HTML code for the gui object
  • access: public
string folder_list (array $attrib)
  • array $attrib: Named parameters
folder_selector (line 1429)

Return folders list as html_select object

  • return: HTML drop-down object
  • access: public
html_select folder_selector ([array $p = array()])
  • array $p: Named parameters
format_date (line 1218)

Convert the given date to a human readable form This uses the date formatting properties from config

  • return: Formatted date string
  • access: public
string format_date (mixed $date, [string $format = null], [bool $convert = true])
  • mixed $date: Date representation (string, timestamp or DateTime object)
  • string $format: Date format to use
  • bool $convert: Enables date convertion according to user timezone
gen_message_id (line 1097)

Unique Message-ID generator.

  • return: Message-ID
  • access: public
string gen_message_id ()
get_action_file (line 810)

Returns current action filename

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

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 (-1 for default addressbook)
  • boolean $writeable: True if the address book needs to be writeable
get_address_sources (line 262)

Return address books list

  • return: Address books array
  • access: public
array get_address_sources ([boolean $writeable = false], [boolean $skip_hidden = false])
  • boolean $writeable: True if the address book needs to be writeable
  • boolean $skip_hidden: True if the address book needs to be not hidden
get_request_token (line 676)

Generate a unique token to be used in a form request

  • return: The request token
  • access: public
string get_request_token ()
html_editor (line 1857)

Output HTML editor scripts

  • access: public
void html_editor ([string $mode = ''])
  • string $mode: Editor mode
imap_connect (line 2114)
  • access: public
void imap_connect ()
imap_init (line 2119)
  • access: public
void imap_init ()
json_init (line 362)

Create an output object for JSON responses

  • return: Reference to JSON output object
  • access: public
rcube_output json_init ()
kill_session (line 638)

Destroy session data and remove cookie

  • access: public
void kill_session ()
load_gui (line 330)

Init output object for GUI and add common scripts.

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

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

Try to localize the given IMAP folder name.

UTF-7 decode it in case no localized text was found

  • return: Localized folder name in UTF-8 encoding
  • access: public
string localize_foldername (string $name, [bool $with_path = true])
  • string $name: Folder name
  • bool $with_path: Enable path localization
localize_folderpath (line 1716)
  • access: public
void localize_folderpath ( $path)
  • $path
login (line 399)

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], [bool $cookiecheck = false])
  • string $username: Mail storage (IMAP) user name
  • string $pass: Mail storage (IMAP) password
  • string $host: Mail storage (IMAP) host
  • bool $cookiecheck: Enables cookie check
login_error (line 573)

Returns error code of last login operation

  • return: Error code
  • access: public
int login_error ()
logout_actions (line 651)

Do server side actions on logout

  • access: public
void logout_actions ()
log_login (line 1139)

Write login data (name, ID, IP address) to the 'userlogins' log file.

  • access: public
void log_login ()
message_part_size (line 2087)

Returns real size (calculated) of the message part

  • return: Part size (and unit)
  • access: public
string message_part_size (rcube_message_part $part)
overwrite_action (line 926)

Overwrite action variable

  • access: public
void overwrite_action (string $action)
  • string $action: New action value
quota_content (line 1759)
  • access: public
void quota_content ([ $attrib = null])
  • $attrib
register_action_map (line 795)

Registers action aliases for current task

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

Return html for a structured list <ul> for the mailbox tree

  • access: public
void render_folder_tree_html ( &$arrFolders,  &$mbox_name,  &$jslist,  $attrib, [ $nestLevel = 0])
  • &$arrFolders
  • &$mbox_name
  • &$jslist
  • $attrib
  • $nestLevel
render_folder_tree_select (line 1617)

Return html for a flat list <select> for the mailbox tree

  • access: public
void render_folder_tree_select ( &$arrFolders,  &$mbox_name,  $maxlength,  &$select, [ $realnames = false], [ $nestLevel = 0], [ $opts = array()])
  • &$arrFolders
  • &$mbox_name
  • $maxlength
  • &$select
  • $realnames
  • $nestLevel
  • $opts
session_init (line 374)

Create session object and start the session.

  • access: public
void session_init ()

Redefinition of:
rcube::session_init()
Create session object and start the session.
set_task (line 127)

Setter for application task

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

Setter for system user object

  • access: public
void set_user (rcube_user $user)
show_bytes (line 2059)

Create a human readable string for a number of bytes

  • return: Byte string
  • access: public
string show_bytes (int $bytes)
  • int $bytes: Number of bytes
shutdown (line 760)

Function to be executed in script shutdown

  • access: public
void shutdown ()

Redefinition of:
rcube::shutdown()
Function to be executed in script shutdown
startup (line 85)

Initial startup function

to register session, create database and imap connections

  • access: protected
void startup ()
storage_connect (line 2129)

Connect to the mail storage server with stored session data

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

Create a HTML table based on the given data

  • return: HTML table code
  • access: public
string table_output (array $attrib, mixed $table_data, array $a_show_cols, string $id_col)
  • array $attrib: Named table attributes
  • mixed $table_data: Table row data. Either a two-dimensional array or a valid SQL result set
  • array $a_show_cols: List of cols to show
  • string $id_col: Name of the identifier col
upload_init (line 1966)

Initializes file uploading interface.

  • access: public
void upload_init ()
upload_progress (line 1934)

File upload progress handler.

  • access: public
void upload_progress ()
url (line 731)

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

Redefinition of:
rcube::url()
Build a valid URL to this instance of Roundcube
user_date (line 1121)

Returns RFC2822 formatted current date in user's timezone

  • return: Date
  • access: public
string user_date ()

Inherited Methods

Inherited From rcube

 rcube::__construct()
 rcube::add_shutdown_function()
 rcube::cache_gc()
 rcube::console()
 rcube::decrypt()
 rcube::encrypt()
 rcube::exec()
 rcube::gettext()
 rcube::get_cache()
 rcube::get_dbh()
 rcube::get_instance()
 rcube::get_memcache()
 rcube::get_storage()
 rcube::get_user_email()
 rcube::get_user_id()
 rcube::get_user_language()
 rcube::get_user_name()
 rcube::get_user_password()
 rcube::init()
 rcube::JQ()
 rcube::language_prop()
 rcube::list_languages()
 rcube::load_language()
 rcube::log_bug()
 rcube::memcache_failure()
 rcube::print_timer()
 rcube::Q()
 rcube::raise_error()
 rcube::session_init()
 rcube::set_storage_prop()
 rcube::shutdown()
 rcube::smtp_init()
 rcube::storage_init()
 rcube::temp_gc()
 rcube::text_exists()
 rcube::timer()
 rcube::url()
 rcube::write_log()
Class Constants
ERROR_COOKIES_DISABLED = 3 (line 62)
ERROR_INVALID_HOST = 2 (line 61)
ERROR_INVALID_REQUEST = 1 (line 60)
ERROR_STORAGE = -2 (line 59)

Inherited Constants

Inherited from rcube

rcube::INIT_WITH_DB
rcube::INIT_WITH_PLUGINS

Documentation generated on Fri, 03 May 2013 12:44:55 +0200 by phpDocumentor 1.4.4