|
|
@ -5,8 +5,8 @@
|
|
|
|
| program/include/rcmail.php |
|
|
|
|
| program/include/rcmail.php |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| This file is part of the Roundcube Webmail client |
|
|
|
|
| This file is part of the Roundcube Webmail client |
|
|
|
|
| Copyright (C) 2008-2012, The Roundcube Dev Team |
|
|
|
|
| Copyright (C) 2008-2013, The Roundcube Dev Team |
|
|
|
|
| Copyright (C) 2011-2012, Kolab Systems AG |
|
|
|
|
| Copyright (C) 2011-2013, Kolab Systems AG |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| Licensed under the GNU General Public License version 3 or |
|
|
|
|
| Licensed under the GNU General Public License version 3 or |
|
|
|
|
| any later version with exceptions for skins & plugins. |
|
|
|
|
| any later version with exceptions for skins & plugins. |
|
|
|
@ -21,7 +21,6 @@
|
|
|
|
+-----------------------------------------------------------------------+
|
|
|
|
+-----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Application class of Roundcube Webmail
|
|
|
|
* Application class of Roundcube Webmail
|
|
|
|
* implemented as singleton
|
|
|
|
* implemented as singleton
|
|
|
@ -67,19 +66,20 @@ class rcmail extends rcube
|
|
|
|
* This implements the 'singleton' design pattern
|
|
|
|
* This implements the 'singleton' design pattern
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param string Environment name to run (e.g. live, dev, test)
|
|
|
|
* @param string Environment name to run (e.g. live, dev, test)
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return rcmail The one and only instance
|
|
|
|
* @return rcmail The one and only instance
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static function get_instance($env = '')
|
|
|
|
static function get_instance($env = '')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!self::$instance || !is_a(self::$instance, 'rcmail')) {
|
|
|
|
if (!self::$instance || !is_a(self::$instance, 'rcmail')) {
|
|
|
|
self::$instance = new rcmail($env);
|
|
|
|
self::$instance = new rcmail($env);
|
|
|
|
self::$instance->startup(); // init AFTER object was linked with self::$instance
|
|
|
|
// init AFTER object was linked with self::$instance
|
|
|
|
|
|
|
|
self::$instance->startup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return self::$instance;
|
|
|
|
return self::$instance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Initial startup function
|
|
|
|
* Initial startup function
|
|
|
|
* to register session, create database and imap connections
|
|
|
|
* to register session, create database and imap connections
|
|
|
@ -89,8 +89,9 @@ class rcmail extends rcube
|
|
|
|
$this->init(self::INIT_WITH_DB | self::INIT_WITH_PLUGINS);
|
|
|
|
$this->init(self::INIT_WITH_DB | self::INIT_WITH_PLUGINS);
|
|
|
|
|
|
|
|
|
|
|
|
// set filename if not index.php
|
|
|
|
// set filename if not index.php
|
|
|
|
if (($basename = basename($_SERVER['SCRIPT_FILENAME'])) && $basename != 'index.php')
|
|
|
|
if (($basename = basename($_SERVER['SCRIPT_FILENAME'])) && $basename != 'index.php') {
|
|
|
|
$this->filename = $basename;
|
|
|
|
$this->filename = $basename;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// start session
|
|
|
|
// start session
|
|
|
|
$this->session_init();
|
|
|
|
$this->session_init();
|
|
|
@ -107,8 +108,10 @@ class rcmail extends rcube
|
|
|
|
// we reset list page when switching to another task
|
|
|
|
// we reset list page when switching to another task
|
|
|
|
// but only to the main task interface - empty action (#1489076)
|
|
|
|
// but only to the main task interface - empty action (#1489076)
|
|
|
|
// this will prevent from unintentional page reset on cross-task requests
|
|
|
|
// this will prevent from unintentional page reset on cross-task requests
|
|
|
|
if ($this->session && $_SESSION['task'] != $this->task && empty($this->action))
|
|
|
|
if ($this->session && $_SESSION['task'] != $this->task && empty($this->action)) {
|
|
|
|
$this->session->remove('page');
|
|
|
|
$this->session->remove('page');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// set current task to session
|
|
|
|
// set current task to session
|
|
|
|
$_SESSION['task'] = $this->task;
|
|
|
|
$_SESSION['task'] = $this->task;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -121,10 +124,10 @@ class rcmail extends rcube
|
|
|
|
|
|
|
|
|
|
|
|
// load plugins
|
|
|
|
// load plugins
|
|
|
|
$this->plugins->init($this, $this->task);
|
|
|
|
$this->plugins->init($this, $this->task);
|
|
|
|
$this->plugins->load_plugins((array)$this->config->get('plugins', array()), array('filesystem_attachments', 'jqueryui'));
|
|
|
|
$this->plugins->load_plugins((array)$this->config->get('plugins', array()),
|
|
|
|
|
|
|
|
array('filesystem_attachments', 'jqueryui'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Setter for application task
|
|
|
|
* Setter for application task
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -142,10 +145,10 @@ class rcmail extends rcube
|
|
|
|
$this->task = $task;
|
|
|
|
$this->task = $task;
|
|
|
|
$this->comm_path = $this->url(array('task' => $this->task));
|
|
|
|
$this->comm_path = $this->url(array('task' => $this->task));
|
|
|
|
|
|
|
|
|
|
|
|
if ($this->output)
|
|
|
|
if ($this->output) {
|
|
|
|
$this->output->set_env('task', $this->task);
|
|
|
|
$this->output->set_env('task', $this->task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Setter for system user object
|
|
|
|
* Setter for system user object
|
|
|
@ -173,7 +176,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return instance of the internal address book class
|
|
|
|
* Return instance of the internal address book class
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -200,7 +202,8 @@ class rcmail extends rcube
|
|
|
|
$contacts = $this->address_books[$id];
|
|
|
|
$contacts = $this->address_books[$id];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($id && $ldap_config[$id]) {
|
|
|
|
else if ($id && $ldap_config[$id]) {
|
|
|
|
$contacts = new rcube_ldap($ldap_config[$id], $this->config->get('ldap_debug'), $this->config->mail_domain($_SESSION['storage_host']));
|
|
|
|
$domain = $this->config->mail_domain($_SESSION['storage_host']);
|
|
|
|
|
|
|
|
$contacts = new rcube_ldap($ldap_config[$id], $this->config->get('ldap_debug'), $domain);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($id === '0') {
|
|
|
|
else if ($id === '0') {
|
|
|
|
$contacts = new rcube_contacts($this->db, $this->get_user_id());
|
|
|
|
$contacts = new rcube_contacts($this->db, $this->get_user_id());
|
|
|
@ -240,9 +243,11 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
self::raise_error(array(
|
|
|
|
self::raise_error(array(
|
|
|
|
'code' => 700, 'type' => 'php',
|
|
|
|
'code' => 700,
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'file' => __FILE__,
|
|
|
|
'message' => "Addressbook source ($id) not found!"),
|
|
|
|
'line' => __LINE__,
|
|
|
|
|
|
|
|
'message' => "Addressbook source ($id) not found!"
|
|
|
|
|
|
|
|
),
|
|
|
|
true, true);
|
|
|
|
true, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -261,7 +266,6 @@ class rcmail extends rcube
|
|
|
|
return $contacts;
|
|
|
|
return $contacts;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return identifier of the address book object
|
|
|
|
* Return identifier of the address book object
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -278,7 +282,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return address books list
|
|
|
|
* Return address books list
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -296,15 +299,17 @@ class rcmail extends rcube
|
|
|
|
|
|
|
|
|
|
|
|
// We are using the DB address book or a plugin address book
|
|
|
|
// We are using the DB address book or a plugin address book
|
|
|
|
if (!empty($abook_type) && strtolower($abook_type) != 'ldap') {
|
|
|
|
if (!empty($abook_type) && strtolower($abook_type) != 'ldap') {
|
|
|
|
if (!isset($this->address_books['0']))
|
|
|
|
if (!isset($this->address_books['0'])) {
|
|
|
|
$this->address_books['0'] = new rcube_contacts($this->db, $this->get_user_id());
|
|
|
|
$this->address_books['0'] = new rcube_contacts($this->db, $this->get_user_id());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$list['0'] = array(
|
|
|
|
$list['0'] = array(
|
|
|
|
'id' => '0',
|
|
|
|
'id' => '0',
|
|
|
|
'name' => $this->gettext('personaladrbook'),
|
|
|
|
'name' => $this->gettext('personaladrbook'),
|
|
|
|
'groups' => $this->address_books['0']->groups,
|
|
|
|
'groups' => $this->address_books['0']->groups,
|
|
|
|
'readonly' => $this->address_books['0']->readonly,
|
|
|
|
'readonly' => $this->address_books['0']->readonly,
|
|
|
|
'autocomplete' => in_array('sql', $autocomplete),
|
|
|
|
|
|
|
|
'undelete' => $this->address_books['0']->undelete && $this->config->get('undo_timeout'),
|
|
|
|
'undelete' => $this->address_books['0']->undelete && $this->config->get('undo_timeout'),
|
|
|
|
|
|
|
|
'autocomplete' => in_array('sql', $autocomplete),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -314,6 +319,7 @@ class rcmail extends rcube
|
|
|
|
if (empty($prop) || !is_array($prop)) {
|
|
|
|
if (empty($prop) || !is_array($prop)) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$list[$id] = array(
|
|
|
|
$list[$id] = array(
|
|
|
|
'id' => $id,
|
|
|
|
'id' => $id,
|
|
|
|
'name' => html::quote($prop['name']),
|
|
|
|
'name' => html::quote($prop['name']),
|
|
|
@ -352,6 +358,7 @@ class rcmail extends rcube
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param boolean True to sort the list alphabetically
|
|
|
|
* @param boolean True to sort the list alphabetically
|
|
|
|
* @param boolean True if only this user's responses shall be listed
|
|
|
|
* @param boolean True if only this user's responses shall be listed
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return array List of the current user's stored responses
|
|
|
|
* @return array List of the current user's stored responses
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function get_compose_responses($sorted = false, $user_only = false)
|
|
|
|
public function get_compose_responses($sorted = false, $user_only = false)
|
|
|
@ -360,18 +367,23 @@ class rcmail extends rcube
|
|
|
|
|
|
|
|
|
|
|
|
if (!$user_only) {
|
|
|
|
if (!$user_only) {
|
|
|
|
foreach ($this->config->get('compose_responses_static', array()) as $response) {
|
|
|
|
foreach ($this->config->get('compose_responses_static', array()) as $response) {
|
|
|
|
if (empty($response['key']))
|
|
|
|
if (empty($response['key'])) {
|
|
|
|
$response['key'] = substr(md5($response['name']), 0, 16);
|
|
|
|
$response['key'] = substr(md5($response['name']), 0, 16);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$response['static'] = true;
|
|
|
|
$response['static'] = true;
|
|
|
|
$response['class'] = 'readonly';
|
|
|
|
$response['class'] = 'readonly';
|
|
|
|
|
|
|
|
|
|
|
|
$k = $sorted ? '0000-' . strtolower($response['name']) : $response['key'];
|
|
|
|
$k = $sorted ? '0000-' . strtolower($response['name']) : $response['key'];
|
|
|
|
$responses[$k] = $response;
|
|
|
|
$responses[$k] = $response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($this->config->get('compose_responses', array()) as $response) {
|
|
|
|
foreach ($this->config->get('compose_responses', array()) as $response) {
|
|
|
|
if (empty($response['key']))
|
|
|
|
if (empty($response['key'])) {
|
|
|
|
$response['key'] = substr(md5($response['name']), 0, 16);
|
|
|
|
$response['key'] = substr(md5($response['name']), 0, 16);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$k = $sorted ? strtolower($response['name']) : $response['key'];
|
|
|
|
$k = $sorted ? strtolower($response['name']) : $response['key'];
|
|
|
|
$responses[$k] = $response;
|
|
|
|
$responses[$k] = $response;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -384,20 +396,21 @@ class rcmail extends rcube
|
|
|
|
return array_values($responses);
|
|
|
|
return array_values($responses);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Init output object for GUI and add common scripts.
|
|
|
|
* Init output object for GUI and add common scripts.
|
|
|
|
* This will instantiate a rcmail_output_html object and set
|
|
|
|
* This will instantiate a rcmail_output_html object and set
|
|
|
|
* environment vars according to the current session and configuration
|
|
|
|
* environment vars according to the current session and configuration
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param boolean True if this request is loaded in a (i)frame
|
|
|
|
* @param boolean True if this request is loaded in a (i)frame
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return rcube_output Reference to HTML output object
|
|
|
|
* @return rcube_output Reference to HTML output object
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function load_gui($framed = false)
|
|
|
|
public function load_gui($framed = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// init output page
|
|
|
|
// init output page
|
|
|
|
if (!($this->output instanceof rcmail_output_html))
|
|
|
|
if (!($this->output instanceof rcmail_output_html)) {
|
|
|
|
$this->output = new rcmail_output_html($this->task, $framed);
|
|
|
|
$this->output = new rcmail_output_html($this->task, $framed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// set refresh interval
|
|
|
|
// set refresh interval
|
|
|
|
$this->output->set_env('refresh_interval', $this->config->get('refresh_interval', 0));
|
|
|
|
$this->output->set_env('refresh_interval', $this->config->get('refresh_interval', 0));
|
|
|
@ -413,8 +426,9 @@ class rcmail extends rcube
|
|
|
|
$this->output->set_env('comm_path', $this->comm_path);
|
|
|
|
$this->output->set_env('comm_path', $this->comm_path);
|
|
|
|
$this->output->set_charset(RCUBE_CHARSET);
|
|
|
|
$this->output->set_charset(RCUBE_CHARSET);
|
|
|
|
|
|
|
|
|
|
|
|
if ($this->user && $this->user->ID)
|
|
|
|
if ($this->user && $this->user->ID) {
|
|
|
|
$this->output->set_env('user_id', $this->user->get_hash());
|
|
|
|
$this->output->set_env('user_id', $this->user->get_hash());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// add some basic labels to client
|
|
|
|
// add some basic labels to client
|
|
|
|
$this->output->add_label('loading', 'servererror', 'requesttimedout', 'refreshing');
|
|
|
|
$this->output->add_label('loading', 'servererror', 'requesttimedout', 'refreshing');
|
|
|
@ -422,7 +436,6 @@ class rcmail extends rcube
|
|
|
|
return $this->output;
|
|
|
|
return $this->output;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create an output object for JSON responses
|
|
|
|
* Create an output object for JSON responses
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -430,13 +443,13 @@ class rcmail extends rcube
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function json_init()
|
|
|
|
public function json_init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!($this->output instanceof rcmail_output_json))
|
|
|
|
if (!($this->output instanceof rcmail_output_json)) {
|
|
|
|
$this->output = new rcmail_output_json($this->task);
|
|
|
|
$this->output = new rcmail_output_json($this->task);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $this->output;
|
|
|
|
return $this->output;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create session object and start the session.
|
|
|
|
* Create session object and start the session.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -445,14 +458,15 @@ class rcmail extends rcube
|
|
|
|
parent::session_init();
|
|
|
|
parent::session_init();
|
|
|
|
|
|
|
|
|
|
|
|
// set initial session vars
|
|
|
|
// set initial session vars
|
|
|
|
if (!$_SESSION['user_id'])
|
|
|
|
if (!$_SESSION['user_id']) {
|
|
|
|
$_SESSION['temp'] = true;
|
|
|
|
$_SESSION['temp'] = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// restore skin selection after logout
|
|
|
|
// restore skin selection after logout
|
|
|
|
if ($_SESSION['temp'] && !empty($_SESSION['skin']))
|
|
|
|
if ($_SESSION['temp'] && !empty($_SESSION['skin'])) {
|
|
|
|
$this->config->set('skin', $_SESSION['skin']);
|
|
|
|
$this->config->set('skin', $_SESSION['skin']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Perfom login to the mail server and to the webmail service.
|
|
|
|
* Perfom login to the mail server and to the webmail service.
|
|
|
@ -480,20 +494,24 @@ class rcmail extends rcube
|
|
|
|
|
|
|
|
|
|
|
|
$config = $this->config->all();
|
|
|
|
$config = $this->config->all();
|
|
|
|
|
|
|
|
|
|
|
|
if (!$host)
|
|
|
|
if (!$host) {
|
|
|
|
$host = $config['default_host'];
|
|
|
|
$host = $config['default_host'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Validate that selected host is in the list of configured hosts
|
|
|
|
// Validate that selected host is in the list of configured hosts
|
|
|
|
if (is_array($config['default_host'])) {
|
|
|
|
if (is_array($config['default_host'])) {
|
|
|
|
$allowed = false;
|
|
|
|
$allowed = false;
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($config['default_host'] as $key => $host_allowed) {
|
|
|
|
foreach ($config['default_host'] as $key => $host_allowed) {
|
|
|
|
if (!is_numeric($key))
|
|
|
|
if (!is_numeric($key)) {
|
|
|
|
$host_allowed = $key;
|
|
|
|
$host_allowed = $key;
|
|
|
|
|
|
|
|
}
|
|
|
|
if ($host == $host_allowed) {
|
|
|
|
if ($host == $host_allowed) {
|
|
|
|
$allowed = true;
|
|
|
|
$allowed = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!$allowed) {
|
|
|
|
if (!$allowed) {
|
|
|
|
$host = null;
|
|
|
|
$host = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -512,6 +530,7 @@ class rcmail extends rcube
|
|
|
|
if ($a_host['host']) {
|
|
|
|
if ($a_host['host']) {
|
|
|
|
$host = $a_host['host'];
|
|
|
|
$host = $a_host['host'];
|
|
|
|
$ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null;
|
|
|
|
$ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null;
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($a_host['port']))
|
|
|
|
if (!empty($a_host['port']))
|
|
|
|
$port = $a_host['port'];
|
|
|
|
$port = $a_host['port'];
|
|
|
|
else if ($ssl && $ssl != 'tls' && (!$config['default_port'] || $config['default_port'] == 143))
|
|
|
|
else if ($ssl && $ssl != 'tls' && (!$config['default_port'] || $config['default_port'] == 143))
|
|
|
@ -591,18 +610,22 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
self::raise_error(array(
|
|
|
|
self::raise_error(array(
|
|
|
|
'code' => 620, 'type' => 'php',
|
|
|
|
'code' => 620,
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'file' => __FILE__,
|
|
|
|
|
|
|
|
'line' => __LINE__,
|
|
|
|
'message' => "Failed to create a user record. Maybe aborted by a plugin?"
|
|
|
|
'message' => "Failed to create a user record. Maybe aborted by a plugin?"
|
|
|
|
), true, false);
|
|
|
|
),
|
|
|
|
|
|
|
|
true, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
self::raise_error(array(
|
|
|
|
self::raise_error(array(
|
|
|
|
'code' => 621, 'type' => 'php',
|
|
|
|
'code' => 621,
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'file' => __FILE__,
|
|
|
|
|
|
|
|
'line' => __LINE__,
|
|
|
|
'message' => "Access denied for new user $username. 'auto_create_user' is disabled"
|
|
|
|
'message' => "Access denied for new user $username. 'auto_create_user' is disabled"
|
|
|
|
), true, false);
|
|
|
|
),
|
|
|
|
|
|
|
|
true, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// login succeeded
|
|
|
|
// login succeeded
|
|
|
@ -628,8 +651,9 @@ class rcmail extends rcube
|
|
|
|
$_SESSION['password'] = $this->encrypt($pass);
|
|
|
|
$_SESSION['password'] = $this->encrypt($pass);
|
|
|
|
$_SESSION['login_time'] = time();
|
|
|
|
$_SESSION['login_time'] = time();
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['_timezone']) && $_REQUEST['_timezone'] != '_default_')
|
|
|
|
if (isset($_REQUEST['_timezone']) && $_REQUEST['_timezone'] != '_default_') {
|
|
|
|
$_SESSION['timezone'] = rcube_utils::get_input_value('_timezone', rcube_utils::INPUT_GPC);
|
|
|
|
$_SESSION['timezone'] = rcube_utils::get_input_value('_timezone', rcube_utils::INPUT_GPC);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// force reloading complete list of subscribed mailboxes
|
|
|
|
// force reloading complete list of subscribed mailboxes
|
|
|
|
$storage->clear_cache('mailboxes', true);
|
|
|
|
$storage->clear_cache('mailboxes', true);
|
|
|
@ -640,7 +664,6 @@ class rcmail extends rcube
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns error code of last login operation
|
|
|
|
* Returns error code of last login operation
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -657,7 +680,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Auto-select IMAP host based on the posted login information
|
|
|
|
* Auto-select IMAP host based on the posted login information
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -701,13 +723,13 @@ class rcmail extends rcube
|
|
|
|
else if (empty($default_host)) {
|
|
|
|
else if (empty($default_host)) {
|
|
|
|
$host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
|
|
|
|
$host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
$host = rcube_utils::parse_host($default_host);
|
|
|
|
$host = rcube_utils::parse_host($default_host);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $host;
|
|
|
|
return $host;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Destroy session data and remove cookie
|
|
|
|
* Destroy session data and remove cookie
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -720,7 +742,6 @@ class rcmail extends rcube
|
|
|
|
$this->user->reset();
|
|
|
|
$this->user->reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Do server side actions on logout
|
|
|
|
* Do server side actions on logout
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -743,7 +764,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Generate a unique token to be used in a form request
|
|
|
|
* Generate a unique token to be used in a form request
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -752,7 +772,10 @@ class rcmail extends rcube
|
|
|
|
public function get_request_token()
|
|
|
|
public function get_request_token()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$sess_id = $_COOKIE[ini_get('session.name')];
|
|
|
|
$sess_id = $_COOKIE[ini_get('session.name')];
|
|
|
|
if (!$sess_id) $sess_id = session_id();
|
|
|
|
|
|
|
|
|
|
|
|
if (!$sess_id) {
|
|
|
|
|
|
|
|
$sess_id = session_id();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$plugin = $this->plugins->exec_hook('request_token', array(
|
|
|
|
$plugin = $this->plugins->exec_hook('request_token', array(
|
|
|
|
'value' => md5('RT' . $this->get_user_id() . $this->config->get('des_key') . $sess_id)));
|
|
|
|
'value' => md5('RT' . $this->get_user_id() . $this->config->get('des_key') . $sess_id)));
|
|
|
@ -760,21 +783,21 @@ class rcmail extends rcube
|
|
|
|
return $plugin['value'];
|
|
|
|
return $plugin['value'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Check if the current request contains a valid token
|
|
|
|
* Check if the current request contains a valid token
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param int Request method
|
|
|
|
* @param int Request method
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return boolean True if request token is valid false if not
|
|
|
|
* @return boolean True if request token is valid false if not
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function check_request($mode = rcube_utils::INPUT_POST)
|
|
|
|
public function check_request($mode = rcube_utils::INPUT_POST)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$token = rcube_utils::get_input_value('_token', $mode);
|
|
|
|
$token = rcube_utils::get_input_value('_token', $mode);
|
|
|
|
$sess_id = $_COOKIE[ini_get('session.name')];
|
|
|
|
$sess_id = $_COOKIE[ini_get('session.name')];
|
|
|
|
|
|
|
|
|
|
|
|
return !empty($sess_id) && $token == $this->get_request_token();
|
|
|
|
return !empty($sess_id) && $token == $this->get_request_token();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Build a valid URL to this instance of Roundcube
|
|
|
|
* Build a valid URL to this instance of Roundcube
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -785,8 +808,9 @@ class rcmail extends rcube
|
|
|
|
public function url($p)
|
|
|
|
public function url($p)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!is_array($p)) {
|
|
|
|
if (!is_array($p)) {
|
|
|
|
if (strpos($p, 'http') === 0)
|
|
|
|
if (strpos($p, 'http') === 0) {
|
|
|
|
return $p;
|
|
|
|
return $p;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$p = array('_action' => @func_get_arg(0));
|
|
|
|
$p = array('_action' => @func_get_arg(0));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -797,6 +821,7 @@ class rcmail extends rcube
|
|
|
|
|
|
|
|
|
|
|
|
$url = './' . $this->filename;
|
|
|
|
$url = './' . $this->filename;
|
|
|
|
$delm = '?';
|
|
|
|
$delm = '?';
|
|
|
|
|
|
|
|
|
|
|
|
foreach (array_reverse($p) as $key => $val) {
|
|
|
|
foreach (array_reverse($p) as $key => $val) {
|
|
|
|
if ($val !== '' && $val !== null) {
|
|
|
|
if ($val !== '' && $val !== null) {
|
|
|
|
$par = $key[0] == '_' ? $key : '_'.$key;
|
|
|
|
$par = $key[0] == '_' ? $key : '_'.$key;
|
|
|
@ -804,10 +829,10 @@ class rcmail extends rcube
|
|
|
|
$delm = '&';
|
|
|
|
$delm = '&';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $url;
|
|
|
|
return $url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Function to be executed in script shutdown
|
|
|
|
* Function to be executed in script shutdown
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -828,6 +853,7 @@ class rcmail extends rcube
|
|
|
|
$mem .= '/'.$this->show_bytes(memory_get_peak_usage());
|
|
|
|
$mem .= '/'.$this->show_bytes(memory_get_peak_usage());
|
|
|
|
|
|
|
|
|
|
|
|
$log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : '');
|
|
|
|
$log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : '');
|
|
|
|
|
|
|
|
|
|
|
|
if (defined('RCMAIL_START'))
|
|
|
|
if (defined('RCMAIL_START'))
|
|
|
|
self::print_timer(RCMAIL_START, $log);
|
|
|
|
self::print_timer(RCMAIL_START, $log);
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -835,7 +861,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Registers action aliases for current task
|
|
|
|
* Registers action aliases for current task
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -850,7 +875,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns current action filename
|
|
|
|
* Returns current action filename
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -865,7 +889,6 @@ class rcmail extends rcube
|
|
|
|
return strtr($this->action, '-', '_') . '.inc';
|
|
|
|
return strtr($this->action, '-', '_') . '.inc';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Fixes some user preferences according to namespace handling change.
|
|
|
|
* Fixes some user preferences according to namespace handling change.
|
|
|
|
* Old Roundcube versions were using folder names with removed namespace prefix.
|
|
|
|
* Old Roundcube versions were using folder names with removed namespace prefix.
|
|
|
@ -926,6 +949,7 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$folders[$idx] = $value;
|
|
|
|
$folders[$idx] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$prefs['search_mods'] = $folders;
|
|
|
|
$prefs['search_mods'] = $folders;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -937,6 +961,7 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$folders[$prefix.$idx] = $value;
|
|
|
|
$folders[$prefix.$idx] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$prefs['message_threading'] = $folders;
|
|
|
|
$prefs['message_threading'] = $folders;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -956,6 +981,7 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$folders_str .= '&'.$value.'&';
|
|
|
|
$folders_str .= '&'.$value.'&';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$prefs['collapsed_folders'] = $folders_str;
|
|
|
|
$prefs['collapsed_folders'] = $folders_str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -966,7 +992,6 @@ class rcmail extends rcube
|
|
|
|
$this->set_storage_prop();
|
|
|
|
$this->set_storage_prop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Overwrite action variable
|
|
|
|
* Overwrite action variable
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -978,7 +1003,6 @@ class rcmail extends rcube
|
|
|
|
$this->output->set_env('action', $action);
|
|
|
|
$this->output->set_env('action', $action);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Set environment variables for specified config options
|
|
|
|
* Set environment variables for specified config options
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -991,7 +1015,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns RFC2822 formatted current date in user's timezone
|
|
|
|
* Returns RFC2822 formatted current date in user's timezone
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1011,7 +1034,6 @@ class rcmail extends rcube
|
|
|
|
return $date->format('r');
|
|
|
|
return $date->format('r');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Write login data (name, ID, IP address) to the 'userlogins' log file.
|
|
|
|
* Write login data (name, ID, IP address) to the 'userlogins' log file.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1043,7 +1065,6 @@ class rcmail extends rcube
|
|
|
|
self::write_log('userlogins', $message);
|
|
|
|
self::write_log('userlogins', $message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create a HTML table based on the given data
|
|
|
|
* Create a HTML table based on the given data
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1093,7 +1114,6 @@ class rcmail extends rcube
|
|
|
|
return $table->show($attrib);
|
|
|
|
return $table->show($attrib);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Convert the given date to a human readable form
|
|
|
|
* Convert the given date to a human readable form
|
|
|
|
* This uses the date formatting properties from config
|
|
|
|
* This uses the date formatting properties from config
|
|
|
@ -1223,7 +1243,6 @@ class rcmail extends rcube
|
|
|
|
return $out;
|
|
|
|
return $out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return folders list in HTML
|
|
|
|
* Return folders list in HTML
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1316,7 +1335,6 @@ class rcmail extends rcube
|
|
|
|
return $out;
|
|
|
|
return $out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return folders list as html_select object
|
|
|
|
* Return folders list as html_select object
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1360,7 +1378,6 @@ class rcmail extends rcube
|
|
|
|
return $select;
|
|
|
|
return $select;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create a hierarchical array of the mailbox list
|
|
|
|
* Create a hierarchical array of the mailbox list
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1418,7 +1435,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return html for a structured list <ul> for the mailbox tree
|
|
|
|
* Return html for a structured list <ul> for the mailbox tree
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1513,7 +1529,6 @@ class rcmail extends rcube
|
|
|
|
return $out;
|
|
|
|
return $out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return html for a flat list <select> for the mailbox tree
|
|
|
|
* Return html for a flat list <select> for the mailbox tree
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1558,7 +1573,6 @@ class rcmail extends rcube
|
|
|
|
return $out;
|
|
|
|
return $out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return internal name for the given folder if it matches the configured special folders
|
|
|
|
* Return internal name for the given folder if it matches the configured special folders
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1577,7 +1591,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Try to localize the given IMAP folder name.
|
|
|
|
* Try to localize the given IMAP folder name.
|
|
|
|
* UTF-7 decode it in case no localized text was found
|
|
|
|
* UTF-7 decode it in case no localized text was found
|
|
|
@ -1695,7 +1708,6 @@ class rcmail extends rcube
|
|
|
|
return $quota_result;
|
|
|
|
return $quota_result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Outputs error message according to server error/response codes
|
|
|
|
* Outputs error message according to server error/response codes
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1749,7 +1761,6 @@ class rcmail extends rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Output HTML editor scripts
|
|
|
|
* Output HTML editor scripts
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1790,7 +1801,6 @@ class rcmail extends rcube
|
|
|
|
$this->output->add_script("rcmail_editor_init($script)", 'docready');
|
|
|
|
$this->output->add_script("rcmail_editor_init($script)", 'docready');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Replaces TinyMCE's emoticon images with plain-text representation
|
|
|
|
* Replaces TinyMCE's emoticon images with plain-text representation
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1828,7 +1838,6 @@ class rcmail extends rcube
|
|
|
|
return preg_replace($search, $replace, $html);
|
|
|
|
return preg_replace($search, $replace, $html);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* File upload progress handler.
|
|
|
|
* File upload progress handler.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1860,7 +1869,6 @@ class rcmail extends rcube
|
|
|
|
$this->output->send();
|
|
|
|
$this->output->send();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Initializes file uploading interface.
|
|
|
|
* Initializes file uploading interface.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1878,6 +1886,7 @@ class rcmail extends rcube
|
|
|
|
// find max filesize value
|
|
|
|
// find max filesize value
|
|
|
|
$max_filesize = parse_bytes(ini_get('upload_max_filesize'));
|
|
|
|
$max_filesize = parse_bytes(ini_get('upload_max_filesize'));
|
|
|
|
$max_postsize = parse_bytes(ini_get('post_max_size'));
|
|
|
|
$max_postsize = parse_bytes(ini_get('post_max_size'));
|
|
|
|
|
|
|
|
|
|
|
|
if ($max_postsize && $max_postsize < $max_filesize) {
|
|
|
|
if ($max_postsize && $max_postsize < $max_filesize) {
|
|
|
|
$max_filesize = $max_postsize;
|
|
|
|
$max_filesize = $max_postsize;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1890,7 +1899,6 @@ class rcmail extends rcube
|
|
|
|
return $max_filesize;
|
|
|
|
return $max_filesize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Initializes client-side autocompletion.
|
|
|
|
* Initializes client-side autocompletion.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -1917,7 +1925,6 @@ class rcmail extends rcube
|
|
|
|
$this->output->add_label('autocompletechars', 'autocompletemore');
|
|
|
|
$this->output->add_label('autocompletechars', 'autocompletemore');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns supported font-family specifications
|
|
|
|
* Returns supported font-family specifications
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1950,7 +1957,6 @@ class rcmail extends rcube
|
|
|
|
return $fonts;
|
|
|
|
return $fonts;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create a human readable string for a number of bytes
|
|
|
|
* Create a human readable string for a number of bytes
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1978,7 +1984,6 @@ class rcmail extends rcube
|
|
|
|
return $str;
|
|
|
|
return $str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns real size (calculated) of the message part
|
|
|
|
* Returns real size (calculated) of the message part
|
|
|
|
*
|
|
|
|
*
|
|
|
|