pull/281/head
Aleksander Machniak 9 years ago
parent 10044b9033
commit a958748947

@ -1,5 +1,5 @@
<?php
/*
/**
+-------------------------------------------------------------------------+
| Roundcube Webmail IMAP Client |
| Version 1.2-git |
@ -62,12 +62,12 @@ if ($err_str = $RCMAIL->db->is_error()) {
rcmail::raise_error(array(
'code' => 603,
'type' => 'db',
'message' => $err_str), FALSE, TRUE);
'message' => $err_str), false, true);
}
// error steps
if ($RCMAIL->action == 'error' && !empty($_GET['_code'])) {
rcmail::raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE);
rcmail::raise_error(array('code' => hexdec($_GET['_code'])), false, true);
}
// check if https is required (for login) and redirect if necessary

@ -1,6 +1,6 @@
<?php
/*
/**
+-------------------------------------------------------------------------+
| Roundcube Webmail setup tool |
| Version 1.2-git |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/bc.php |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/clisetup.php |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/iniset.php |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/rcmail.php |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/rcmail_html_page.php |
| |
@ -19,11 +19,10 @@
+-----------------------------------------------------------------------+
*/
/**
* Class to create an empty HTML page with some default styles
*
* @package Webmail
* @package Webmail
* @subpackage View
*/
class rcmail_html_page extends rcmail_output_html

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| rcmail_install.php |
| |
@ -13,13 +13,12 @@
+-----------------------------------------------------------------------+
*/
/**
* Class to control the installation process of the Roundcube Webmail package
*
* @category Install
* @package Roundcube
* @author Thomas Bruederli
* @author Thomas Bruederli
*/
class rcmail_install
{

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/rcmail_output.php |
| |
@ -30,11 +30,11 @@ abstract class rcmail_output extends rcube_output
const JS_OBJECT_NAME = 'rcmail';
const BLANK_GIF = 'R0lGODlhDwAPAIAAAMDAwAAAACH5BAEAAAAALAAAAAAPAA8AQAINhI+py+0Po5y02otnAQA7';
public $type = 'html';
public $type = 'html';
public $ajax_call = false;
public $framed = false;
public $framed = false;
protected $pagetitle = '';
protected $pagetitle = '';
protected $object_handlers = array();
@ -46,7 +46,6 @@ abstract class rcmail_output extends rcube_output
parent::__construct();
}
/**
* Setter for page title
*
@ -57,7 +56,6 @@ abstract class rcmail_output extends rcube_output
$this->pagetitle = $title;
}
/**
* Getter for the current skin path property
*/
@ -66,7 +64,6 @@ abstract class rcmail_output extends rcube_output
return $this->config->get('skin_path');
}
/**
* Delete all stored env variables and commands
*/
@ -78,7 +75,6 @@ abstract class rcmail_output extends rcube_output
$this->pagetitle = '';
}
/**
* Call a client method
*
@ -87,13 +83,11 @@ abstract class rcmail_output extends rcube_output
*/
abstract function command();
/**
* Add a localized label to the client environment
*/
abstract function add_label();
/**
* Register a template object handler
*
@ -106,7 +100,6 @@ abstract class rcmail_output extends rcube_output
$this->object_handlers[$obj] = $func;
}
/**
* Register a list of template object handlers
*
@ -117,5 +110,4 @@ abstract class rcmail_output extends rcube_output
{
$this->object_handlers = array_merge($this->object_handlers, $arr);
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/rcmail_output_cli.php |
| |
@ -85,5 +85,4 @@ class rcmail_output_cli extends rcmail_output
{
// NOP
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/rcmail_output_html.php |
| |
@ -19,7 +19,6 @@
+-----------------------------------------------------------------------+
*/
/**
* Class to create HTML page output using a skin template
*
@ -2035,5 +2034,4 @@ EOF;
return $content;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/rcmail_output_json.php |
| |
@ -19,7 +19,6 @@
+-----------------------------------------------------------------------+
*/
/**
* View class to produce JSON responses
*
@ -28,12 +27,12 @@
*/
class rcmail_output_json extends rcmail_output
{
protected $texts = array();
protected $commands = array();
protected $texts = array();
protected $commands = array();
protected $callbacks = array();
protected $message = null;
protected $message = null;
public $type = 'js';
public $type = 'js';
public $ajax_call = true;
@ -49,10 +48,9 @@ class rcmail_output_json extends rcmail_output
else
$name = $this->config->get('product_name');
$this->command('set_pagetitle', empty($name) ? $title : $name.' :: '.$title);
$this->command('set_pagetitle', empty($name) ? $title : $name . ' :: ' . $title);
}
/**
* Register a template object handler
*
@ -64,7 +62,6 @@ class rcmail_output_json extends rcmail_output
// ignore
}
/**
* Register a list of template object handlers
*
@ -75,7 +72,6 @@ class rcmail_output_json extends rcmail_output
// ignore
}
/**
* Call a client method
*
@ -92,7 +88,6 @@ class rcmail_output_json extends rcmail_output
$this->commands[] = $cmd;
}
/**
* Add a localized label to the client environment
*/
@ -107,7 +102,6 @@ class rcmail_output_json extends rcmail_output
}
}
/**
* Invoke display_message command
*
@ -135,18 +129,16 @@ class rcmail_output_json extends rcmail_output
}
}
/**
* Delete all stored env variables and commands
*/
public function reset()
{
parent::reset();
$this->texts = array();
$this->texts = array();
$this->commands = array();
}
/**
* Redirect to a certain url
*
@ -162,7 +154,6 @@ class rcmail_output_json extends rcmail_output
exit;
}
/**
* Send an AJAX response to the client.
*/
@ -172,7 +163,6 @@ class rcmail_output_json extends rcmail_output
exit;
}
/**
* Show error page and terminate script execution
*
@ -191,7 +181,6 @@ class rcmail_output_json extends rcmail_output
exit;
}
/**
* Send an AJAX response with executable JS code
*
@ -242,7 +231,6 @@ class rcmail_output_json extends rcmail_output
echo self::json_serialize($response);
}
/**
* Return executable javascript code for all registered commands
*

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/rcmail_string_replacer.php |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/include/rcmail_utils.php |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube PHP suite |
| Copyright (C) 2005-2015, The Roundcube Dev Team |
@ -17,7 +17,6 @@
+-----------------------------------------------------------------------+
*/
/**
* Roundcube Framework Initialization
*
@ -124,7 +123,6 @@ function in_array_nocase($needle, $haystack)
return false;
}
/**
* Parse a human readable string for a number of bytes.
*
@ -159,7 +157,6 @@ function parse_bytes($str)
return floatval($bytes);
}
/**
* Make sure the string ends with a slash
*/
@ -168,7 +165,6 @@ function slashify($str)
return unslashify($str).'/';
}
/**
* Remove slashes at the end of the string
*/
@ -177,7 +173,6 @@ function unslashify($str)
return preg_replace('/\/+$/', '', $str);
}
/**
* Returns number of seconds for a specified offset string.
*
@ -210,7 +205,6 @@ function get_offset_sec($str)
return $amount;
}
/**
* Create a unix timestamp with a specified offset from now.
*
@ -224,7 +218,6 @@ function get_offset_time($offset_str, $factor=1)
return time() + get_offset_sec($offset_str) * $factor;
}
/**
* Truncate string if it is longer than the allowed length.
* Replace the middle or the ending part of a string with a placeholder.
@ -255,7 +248,6 @@ function abbreviate_string($str, $maxlength, $placeholder='...', $ending=false)
return $str;
}
/**
* Get all keys from array (recursive).
*
@ -279,7 +271,6 @@ function array_keys_recursive($array)
return $keys;
}
/**
* Remove all non-ascii and non-word chars except ., -, _
*/
@ -289,7 +280,6 @@ function asciiwords($str, $css_id = false, $replace_with = '')
return preg_replace("/[^$allowed]/i", $replace_with, $str);
}
/**
* Check if a string contains only ascii characters
*
@ -304,7 +294,6 @@ function is_ascii($str, $control_chars = true)
return preg_match($regexp, $str) ? false : true;
}
/**
* Compose a valid representation of name and e-mail address
*
@ -329,7 +318,6 @@ function format_email_recipient($email, $name = '')
return $email;
}
/**
* Format e-mail address
*
@ -352,7 +340,6 @@ function format_email($email)
return $email;
}
/**
* Fix version number so it can be used correctly in version_compare()
*
@ -368,7 +355,6 @@ function version_parse($version)
$version);
}
/**
* mbstring replacement functions
*/

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2013, The Roundcube Dev Team |
@ -16,7 +16,6 @@
+-----------------------------------------------------------------------+
*/
/**
* Class for HTML code creation
*
@ -26,7 +25,7 @@
class html
{
protected $tagname;
protected $attrib = array();
protected $attrib = array();
protected $allowed = array();
protected $content;
@ -66,13 +65,15 @@ class html
* @param string $tagname Tag name
* @param array $attrib Tag attributes as key/value pairs
* @param string $content Optinal Tag content (creates a container tag)
* @param array $allowed_attrib List with allowed attributes, omit to allow all
* @param array $allowed List with allowed attributes, omit to allow all
*
* @return string The XHTML tag
*/
public static function tag($tagname, $attrib = array(), $content = null, $allowed_attrib = null)
public static function tag($tagname, $attrib = array(), $content = null, $allowed = null)
{
if (is_string($attrib))
if (is_string($attrib)) {
$attrib = array('class' => $attrib);
}
$inline_tags = array('a','span','img');
$suffix = $attrib['nl'] || ($content && $attrib['nl'] !== false && !in_array($tagname, $inline_tags)) ? "\n" : '';
@ -81,15 +82,17 @@ class html
if (isset($content) || in_array($tagname, self::$containers)) {
$suffix = $attrib['noclose'] ? $suffix : '</' . $tagname . '>' . $suffix;
unset($attrib['noclose'], $attrib['nl']);
return '<' . $tagname . self::attrib_string($attrib, $allowed_attrib) . '>' . $content . $suffix;
return '<' . $tagname . self::attrib_string($attrib, $allowed) . '>' . $content . $suffix;
}
else {
return '<' . $tagname . self::attrib_string($attrib, $allowed_attrib) . '>' . $suffix;
return '<' . $tagname . self::attrib_string($attrib, $allowed) . '>' . $suffix;
}
}
/**
* Return DOCTYPE tag of specified type
*
* @param string $type Document type (html5, xhtml, 'xhtml-trans, xhtml-strict)
*/
public static function doctype($type)
{
@ -113,6 +116,7 @@ class html
*
* @param mixed $attr Hash array with tag attributes or string with class name
* @param string $cont Div content
*
* @return string HTML code
* @see html::tag()
*/
@ -121,6 +125,7 @@ class html
if (is_string($attr)) {
$attr = array('class' => $attr);
}
return self::tag('div', $attr, $cont, array_merge(self::$common_attrib, array('onclick')));
}
@ -129,6 +134,7 @@ class html
*
* @param mixed $attr Hash array with tag attributes or string with class name
* @param string $cont Paragraph content
*
* @return string HTML code
* @see html::tag()
*/
@ -137,6 +143,7 @@ class html
if (is_string($attr)) {
$attr = array('class' => $attr);
}
return self::tag('p', $attr, $cont, self::$common_attrib);
}
@ -144,6 +151,7 @@ class html
* Derrived method to create <img />
*
* @param mixed $attr Hash array with tag attributes or string with image source (src)
*
* @return string HTML code
* @see html::tag()
*/
@ -152,6 +160,7 @@ class html
if (is_string($attr)) {
$attr = array('src' => $attr);
}
return self::tag('img', $attr + array('alt' => ''), null, array_merge(self::$common_attrib,
array('src','alt','width','height','border','usemap','onclick','onerror')));
}
@ -161,6 +170,7 @@ class html
*
* @param mixed $attr Hash array with tag attributes or string with link location (href)
* @param string $cont Link content
*
* @return string HTML code
* @see html::tag()
*/
@ -169,6 +179,7 @@ class html
if (is_string($attr)) {
$attr = array('href' => $attr);
}
return self::tag('a', $attr, $cont, array_merge(self::$common_attrib,
array('href','target','name','rel','onclick','onmouseover','onmouseout','onmousedown','onmouseup')));
}
@ -178,6 +189,7 @@ class html
*
* @param mixed $attr Hash array with tag attributes or string with class name
* @param string $cont Tag content
*
* @return string HTML code
* @see html::tag()
*/
@ -186,6 +198,7 @@ class html
if (is_string($attr)) {
$attr = array('class' => $attr);
}
return self::tag('span', $attr, $cont, self::$common_attrib);
}
@ -194,6 +207,7 @@ class html
*
* @param mixed $attr Hash array with tag attributes or string with 'for' attrib
* @param string $cont Tag content
*
* @return string HTML code
* @see html::tag()
*/
@ -202,6 +216,7 @@ class html
if (is_string($attr)) {
$attr = array('for' => $attr);
}
return self::tag('label', $attr, $cont, array_merge(self::$common_attrib, array('for')));
}
@ -209,6 +224,7 @@ class html
* Derrived method to create <iframe></iframe>
*
* @param mixed $attr Hash array with tag attributes or string with frame source (src)
*
* @return string HTML code
* @see html::tag()
*/
@ -217,6 +233,7 @@ class html
if (is_string($attr)) {
$attr = array('src' => $attr);
}
return self::tag('iframe', $attr, $cont, array_merge(self::$common_attrib,
array('src','name','width','height','border','frameborder','onload','allowfullscreen')));
}
@ -224,8 +241,9 @@ class html
/**
* Derrived method to create <script> tags
*
* @param mixed $attr Hash array with tag attributes or string with script source (src)
* @param mixed $attr Hash array with tag attributes or string with script source (src)
* @param string $cont Javascript code to be placed as tag content
*
* @return string HTML code
* @see html::tag()
*/
@ -248,6 +266,8 @@ class html
/**
* Derrived method for line breaks
*
* @param array $attrib Associative arry with tag attributes
*
* @return string HTML code
* @see html::tag()
*/
@ -259,8 +279,9 @@ class html
/**
* Create string with attributes
*
* @param array $attrib Associative arry with tag attributes
* @param array $attrib Associative arry with tag attributes
* @param array $allowed List of allowed attributes
*
* @return string Valid attribute string
*/
public static function attrib_string($attrib = array(), $allowed = null)
@ -315,6 +336,7 @@ class html
* Convert a HTML attribute string attributes to an associative array (name => value)
*
* @param string Input string
*
* @return array Key-value pairs of parsed attributes
*/
public static function parse_attrib_string($str)
@ -366,7 +388,7 @@ class html
class html_inputfield extends html
{
protected $tagname = 'input';
protected $type = 'text';
protected $type = 'text';
protected $allowed = array(
'type','name','value','size','tabindex','autocapitalize','required',
'autocomplete','checked','onchange','onclick','disabled','readonly',
@ -393,8 +415,9 @@ class html_inputfield extends html
/**
* Compose input tag
*
* @param string $value Field value
* @param string $value Field value
* @param array $attrib Additional attributes to override
*
* @return string HTML output
*/
public function show($value = null, $attrib = null)
@ -410,6 +433,7 @@ class html_inputfield extends html
}
// set type
$this->attrib['type'] = $this->type;
return parent::show();
}
}
@ -434,9 +458,9 @@ class html_passwordfield extends html_inputfield
class html_hiddenfield extends html
{
protected $tagname = 'input';
protected $type = 'hidden';
protected $fields_arr = array();
protected $type = 'hidden';
protected $allowed = array('type','name','value','onchange','disabled','readonly');
protected $fields_arr = array();
/**
* Constructor
@ -471,6 +495,7 @@ class html_hiddenfield extends html
foreach ($this->fields_arr as $attrib) {
$out .= self::tag($this->tagname, array('type' => $this->type) + $attrib);
}
return $out;
}
}
@ -490,6 +515,7 @@ class html_radiobutton extends html_inputfield
*
* @param string $value Value of the checked field
* @param array $attrib Additional attributes to override
*
* @return string HTML output
*/
public function show($value = '', $attrib = null)
@ -521,6 +547,7 @@ class html_checkbox extends html_inputfield
*
* @param string $value Value of the checked field
* @param array $attrib Additional attributes to override
*
* @return string HTML output
*/
public function show($value = '', $attrib = null)
@ -554,6 +581,7 @@ class html_textarea extends html
*
* @param string $value Textbox value
* @param array $attrib Additional attributes to override
*
* @return string HTML output
*/
public function show($value = '', $attrib = null)
@ -633,6 +661,7 @@ class html_select extends html
*
* @param string $select Value of the selection option
* @param array $attrib Additional attributes to override
*
* @return string HTML output
*/
public function show($select = array(), $attrib = null)
@ -675,8 +704,8 @@ class html_table extends html
protected $allowed = array('id','class','style','width','summary',
'cellpadding','cellspacing','border');
private $header = array();
private $rows = array();
private $header = array();
private $rows = array();
private $rowindex = 0;
private $colindex = 0;
@ -776,7 +805,7 @@ class html_table extends html
$this->colindex = 0;
$this->rows[$this->rowindex] = new stdClass;
$this->rows[$this->rowindex]->attrib = $attr;
$this->rows[$this->rowindex]->cells = array();
$this->rows[$this->rowindex]->cells = array();
}
/**
@ -823,6 +852,7 @@ class html_table extends html
* Build HTML output of the table data
*
* @param array $attrib Table attributes
*
* @return string The final table HTML code
*/
public function show($attrib = null)
@ -910,5 +940,4 @@ class html_table extends html
static $col_tagnames = array('table' => 'td', '*' => 'span');
return $col_tagnames[$this->tagname] ?: $col_tagnames['*'];
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2014, The Roundcube Dev Team |
@ -18,7 +18,6 @@
+-----------------------------------------------------------------------+
*/
/**
* Base class of the Roundcube Framework
* implemented as singleton
@ -140,7 +139,6 @@ class rcube
return self::$instance;
}
/**
* Private constructor
*/
@ -153,7 +151,6 @@ class rcube
register_shutdown_function(array($this, 'shutdown'));
}
/**
* Initial startup function
*/
@ -177,7 +174,6 @@ class rcube
}
}
/**
* Get the current database connection
*
@ -198,7 +194,6 @@ class rcube
return $this->db;
}
/**
* Get global handle for memcache access
*
@ -245,7 +240,6 @@ class rcube
return $this->memcache;
}
/**
* Callback for memcache failure
*/
@ -264,7 +258,6 @@ class rcube
}
}
/**
* Initialize and get cache object
*
@ -284,7 +277,6 @@ class rcube
return $this->caches[$name];
}
/**
* Initialize and get shared cache object
*
@ -317,11 +309,10 @@ class rcube
return $this->caches[$shared_name];
}
/**
* Create SMTP object and connect to server
*
* @param boolean True if connection should be established
* @param boolean $connect True if connection should be established
*/
public function smtp_init($connect = false)
{
@ -332,7 +323,6 @@ class rcube
}
}
/**
* Initialize and get storage object
*
@ -348,7 +338,6 @@ class rcube
return $this->storage;
}
/**
* Initialize storage object
*/
@ -447,7 +436,6 @@ class rcube
}
}
/**
* Set special folders type association.
* This must be done AFTER connecting to the server!
@ -477,7 +465,6 @@ class rcube
}
}
/**
* Callback for IMAP connection events to log session identifiers
*/
@ -545,7 +532,6 @@ class rcube
$this->gc_temp();
}
/**
* Garbage collector function for temp files.
* Remove temp files older than two days
@ -577,7 +563,6 @@ class rcube
}
}
/**
* Runs garbage collector with probability based on
* session settings. This is intended for environments
@ -596,7 +581,6 @@ class rcube
}
}
/**
* Get localized text in the desired language
*
@ -653,7 +637,6 @@ class rcube
return strtr($text, array('\n' => "\n"));
}
/**
* Check if the given text label exists
*
@ -693,7 +676,6 @@ class rcube
return false;
}
/**
* Load a localization package
*
@ -748,11 +730,10 @@ class rcube
}
}
/**
* Check the given string and return a valid language code
*
* @param string Language code
* @param string $lang Language code
*
* @return string Valid language code
*/
@ -799,7 +780,6 @@ class rcube
return $lang;
}
/**
* Read directory program/localization and return a list of available languages
*
@ -829,13 +809,12 @@ class rcube
return $sa_languages;
}
/**
* Encrypt using 3DES
*
* @param string $clear clear text input
* @param string $key encryption key to retrieve from the configuration, defaults to 'des_key'
* @param boolean $base64 whether or not to base64_encode() the result before returning
* @param string $clear Clear text input
* @param string $key Encryption key to retrieve from the configuration, defaults to 'des_key'
* @param boolean $base64 Whether or not to base64_encode() the result before returning
*
* @return string encrypted text
*/
@ -845,11 +824,9 @@ class rcube
return '';
}
/*-
* Add a single canary byte to the end of the clear text, which
* will help find out how much of padding will need to be removed
* upon decryption; see http://php.net/mcrypt_generic#68082
*/
// Add a single canary byte to the end of the clear text, which
// will help find out how much of padding will need to be removed
// upon decryption; see http://php.net/mcrypt_generic#68082.
$clear = pack("a*H2", $clear, "80");
$ckey = $this->config->get_crypto_key($key);
@ -888,13 +865,12 @@ class rcube
return $base64 ? base64_encode($cipher) : $cipher;
}
/**
* Decrypt 3DES-encrypted string
*
* @param string $cipher encrypted text
* @param string $key encryption key to retrieve from the configuration, defaults to 'des_key'
* @param boolean $base64 whether or not input is base64-encoded
* @param string $cipher Encrypted text
* @param string $key Encryption key to retrieve from the configuration, defaults to 'des_key'
* @param boolean $base64 Whether or not input is base64-encoded
*
* @return string decrypted text
*/
@ -956,20 +932,17 @@ class rcube
}
}
/*-
* Trim PHP's padding and the canary byte; see note in
* rcube::encrypt() and http://php.net/mcrypt_generic#68082
*/
// Trim PHP's padding and the canary byte; see note in
// rcube::encrypt() and http://php.net/mcrypt_generic#68082
$clear = substr(rtrim($clear, "\0"), 0, -1);
return $clear;
}
/**
* Generates encryption initialization vector (IV)
*
* @param int Vector size
* @param int $size Vector size
*
* @return string Vector string
*/
@ -985,7 +958,6 @@ class rcube
return $iv;
}
/**
* Returns session token for secure URLs
*
@ -1013,7 +985,6 @@ class rcube
return false;
}
/**
* Generate a unique token to be used in a form request
*
@ -1032,12 +1003,11 @@ class rcube
return $plugin['value'];
}
/**
* Check if the current request contains a valid token.
* Empty requests aren't checked until use_secure_urls is set.
*
* @param int Request method
* @param int $mode Request method
*
* @return boolean True if request token is valid false if not
*/
@ -1082,11 +1052,11 @@ class rcube
return true;
}
/**
* Build a valid URL to this instance of Roundcube
*
* @param mixed Either a string with the action or url parameters as key-value pairs
* @param mixed $p Either a string with the action or url parameters as key-value pairs
*
* @return string Valid application URL
*/
public function url($p)
@ -1095,7 +1065,6 @@ class rcube
return '';
}
/**
* Function to be executed in script shutdown
* Registered with register_shutdown_function()
@ -1129,7 +1098,6 @@ class rcube
}
}
/**
* Registers shutdown function to be executed on shutdown.
* The functions will be executed before destroying any
@ -1142,7 +1110,6 @@ class rcube
$this->shutdown_functions[] = $function;
}
/**
* Quote a given string.
* Shortcut function for rcube_utils::rep_specialchars_output()
@ -1154,7 +1121,6 @@ class rcube
return rcube_utils::rep_specialchars_output($str, 'html', $mode, $newlines);
}
/**
* Quote a given string for javascript output.
* Shortcut function for rcube_utils::rep_specialchars_output()
@ -1166,12 +1132,11 @@ class rcube
return rcube_utils::rep_specialchars_output($str, 'js');
}
/**
* Construct shell command, execute it and return output as string.
* Keywords {keyword} are replaced with arguments
*
* @param $cmd Format string with {keywords} to be replaced
* @param $cmd Format string with {keywords} to be replaced
* @param $values (zero, one or more arrays can be passed)
*
* @return output of command. shell errors not detectable
@ -1219,7 +1184,6 @@ class rcube
return (string)shell_exec($cmd);
}
/**
* Print or write debug messages
*
@ -1230,12 +1194,13 @@ class rcube
$args = func_get_args();
if (class_exists('rcube', false)) {
$rcube = self::get_instance();
$rcube = self::get_instance();
$plugin = $rcube->plugins->exec_hook('console', array('args' => $args));
if ($plugin['abort']) {
return;
}
$args = $plugin['args'];
$args = $plugin['args'];
}
$msg = array();
@ -1246,13 +1211,12 @@ class rcube
self::write_log('console', join(";\n", $msg));
}
/**
* Append a line to a logfile in the logs directory.
* Date will be added automatically to the line.
*
* @param $name name of log file
* @param line Line to append
* @param string $name Name of the log file
* @param mixed $line Line to append
*/
public static function write_log($name, $line)
{
@ -1330,18 +1294,17 @@ class rcube
return false;
}
/**
* Throw system error (and show error page).
*
* @param array Named parameters
* @param array $arg Named parameters
* - code: Error code (required)
* - type: Error type [php|db|imap|javascript] (required)
* - message: Error message
* - file: File where error occurred
* - line: Line where error occurred
* @param boolean True to log the error
* @param boolean Terminate script execution
* @param boolean $log True to log the error
* @param boolean $terminate Terminate script execution
*/
public static function raise_error($arg = array(), $log = false, $terminate = false)
{
@ -1393,11 +1356,10 @@ class rcube
}
}
/**
* Report error according to configured debug_level
*
* @param array Named parameters
* @param array $arg_arr Named parameters
* @see self::raise_error()
*/
public static function log_bug($arg_arr)
@ -1452,13 +1414,12 @@ class rcube
}
}
/**
* Write debug info to the log
*
* @param string Engine type - file name (memcache, apc)
* @param string Data string to log
* @param bool Operation result
* @param string $engine Engine type - file name (memcache, apc)
* @param string $data Data string to log
* @param bool $result Operation result
*/
public static function debug($engine, $data, $result = null)
{
@ -1478,7 +1439,6 @@ class rcube
self::write_log($engine, $line);
}
/**
* Returns current time (with microseconds).
*
@ -1489,13 +1449,12 @@ class rcube
return microtime(true);
}
/**
* Logs time difference according to provided timer
*
* @param float $timer Timer (self::timer() result)
* @param string $label Log line prefix
* @param string $dest Log file name
* @param float $timer Timer (self::timer() result)
* @param string $label Log line prefix
* @param string $dest Log file name
*
* @see self::timer()
*/
@ -1546,7 +1505,6 @@ class rcube
return null;
}
/**
* Getter for logged user name.
*
@ -1562,7 +1520,6 @@ class rcube
}
}
/**
* Getter for logged user email (derived from user name not identity).
*
@ -1575,7 +1532,6 @@ class rcube
}
}
/**
* Getter for logged user password.
*
@ -1644,13 +1600,13 @@ class rcube
/**
* Send the given message using the configured method.
*
* @param object $message Reference to Mail_MIME object
* @param string $from Sender address string
* @param array $mailto Array of recipient address strings
* @param array $error SMTP error array (reference)
* @param string $body_file Location of file with saved message body (reference),
* used when delay_file_io is enabled
* @param array $options SMTP options (e.g. DSN request)
* @param object $message Reference to Mail_MIME object
* @param string $from Sender address string
* @param array $mailto Array of recipient address strings
* @param array $error SMTP error array (reference)
* @param string $body_file Location of file with saved message body (reference),
* used when delay_file_io is enabled
* @param array $options SMTP options (e.g. DSN request)
*
* @return boolean Send status.
*/
@ -1821,14 +1777,13 @@ class rcube
return $sent;
}
}
/**
* Lightweight plugin API class serving as a dummy if plugins are not enabled
*
* @package Framework
* @package Framework
* @subpackage Core
*/
class rcube_dummy_plugin_api

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2006-2013, The Roundcube Dev Team |
@ -16,7 +16,6 @@
+-----------------------------------------------------------------------+
*/
/**
* Abstract skeleton of an address book/repository
*
@ -26,27 +25,32 @@
abstract class rcube_addressbook
{
/** constants for error reporting **/
const ERROR_READ_ONLY = 1;
const ERROR_READ_ONLY = 1;
const ERROR_NO_CONNECTION = 2;
const ERROR_VALIDATE = 3;
const ERROR_SAVING = 4;
const ERROR_SEARCH = 5;
const ERROR_VALIDATE = 3;
const ERROR_SAVING = 4;
const ERROR_SEARCH = 5;
/** public properties (mandatory) */
public $primary_key;
public $groups = false;
public $groups = false;
public $export_groups = true;
public $readonly = true;
public $searchonly = false;
public $undelete = false;
public $ready = false;
public $group_id = null;
public $list_page = 1;
public $page_size = 10;
public $sort_col = 'name';
public $sort_order = 'ASC';
public $coltypes = array('name' => array('limit'=>1), 'firstname' => array('limit'=>1), 'surname' => array('limit'=>1), 'email' => array('limit'=>1));
public $date_cols = array();
public $readonly = true;
public $searchonly = false;
public $undelete = false;
public $ready = false;
public $group_id = null;
public $list_page = 1;
public $page_size = 10;
public $sort_col = 'name';
public $sort_order = 'ASC';
public $date_cols = array();
public $coltypes = array(
'name' => array('limit'=>1),
'firstname' => array('limit'=>1),
'surname' => array('limit'=>1),
'email' => array('limit'=>1)
);
protected $error;
@ -685,6 +689,4 @@ abstract class rcube_addressbook
return false;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -29,27 +29,44 @@ class rcube_base_replacer
private $base_url;
/**
* Class constructor
*
* @param string $base Base URL
*/
public function __construct($base)
{
$this->base_url = $base;
}
/**
* Replace callback
*
* @param array $matches Matching entries
*
* @return string Replaced text with absolute URL
*/
public function callback($matches)
{
return $matches[1] . '="' . self::absolute_url($matches[3], $this->base_url) . '"';
}
/**
* Convert base URLs to absolute ones
*
* @param string $body Text body
*
* @return string Replaced text
*/
public function replace($body)
{
return preg_replace_callback(array(
$regexp = array(
'/(src|background|href)=(["\']?)([^"\'\s>]+)(\2|\s|>)/i',
'/(url\s*\()(["\']?)([^"\'\)\s]+)(\2)\)/i',
),
array($this, 'callback'), $body);
}
);
return preg_replace_callback($regexp, array($this, 'callback'), $body);
}
/**
* Convert paths like ../xxx to an absolute path using a base url

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2007-2009, The Roundcube Dev Team |
@ -65,4 +65,3 @@ class rcube_browser
$this->imgdata = !$this->ie;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2011, The Roundcube Dev Team |
@ -18,7 +18,6 @@
+-----------------------------------------------------------------------+
*/
/**
* Interface class for accessing Roundcube cache
*
@ -92,7 +91,6 @@ class rcube_cache
$this->prefix = $prefix;
}
/**
* Returns cached value.
*
@ -109,7 +107,6 @@ class rcube_cache
return $this->cache[$key];
}
/**
* Sets (add/update) value in cache.
*
@ -122,7 +119,6 @@ class rcube_cache
$this->cache_changes[$key] = true;
}
/**
* Returns cached value without storing it in internal memory.
*
@ -139,7 +135,6 @@ class rcube_cache
return $this->read_record($key, true);
}
/**
* Sets (add/update) value in cache and immediately saves
* it in the backend, no internal memory will be used.
@ -154,7 +149,6 @@ class rcube_cache
return $this->write_record($key, $this->serialize($data));
}
/**
* Clears the cache.
*
@ -191,7 +185,6 @@ class rcube_cache
$this->remove_record($key, $prefix_mode);
}
/**
* Remove cache records older than ttl
*/
@ -208,7 +201,6 @@ class rcube_cache
}
}
/**
* Remove expired records of all caches
*/
@ -220,7 +212,6 @@ class rcube_cache
$db->query("DELETE FROM " . $db->table_name('cache', true) . " WHERE `expires` < " . $db->now());
}
/**
* Writes the cache back to the DB.
*/
@ -244,7 +235,6 @@ class rcube_cache
}
}
/**
* Reads cache entry.
*
@ -330,7 +320,6 @@ class rcube_cache
return $this->cache[$key];
}
/**
* Writes single cache record into DB.
*
@ -408,7 +397,6 @@ class rcube_cache
return $this->db->affected_rows($result);
}
/**
* Deletes the cache record(s).
*
@ -473,7 +461,6 @@ class rcube_cache
$this->userid);
}
/**
* Adds entry into memcache/apc DB.
*
@ -506,7 +493,6 @@ class rcube_cache
return $result;
}
/**
* Deletes entry from memcache/apc DB.
*
@ -531,7 +517,6 @@ class rcube_cache
return $result;
}
/**
* Writes the index entry into memcache/apc DB.
*/
@ -561,7 +546,6 @@ class rcube_cache
$this->add_record($this->ikey(), $data);
}
/**
* Gets the index entry from memcache/apc DB.
*/
@ -591,7 +575,6 @@ class rcube_cache
$this->index = $data ? unserialize($data) : array();
}
/**
* Creates per-user cache key name (for memcache and apc)
*
@ -604,7 +587,6 @@ class rcube_cache
return sprintf('%d:%s:%s', $this->userid, $this->prefix, $key);
}
/**
* Creates per-user index cache key name (for memcache and apc)
*

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2011-2013, The Roundcube Dev Team |
@ -18,7 +18,6 @@
+-----------------------------------------------------------------------+
*/
/**
* Interface class for accessing Roundcube shared cache
*
@ -89,7 +88,6 @@ class rcube_cache_shared
$this->prefix = $prefix;
}
/**
* Returns cached value.
*
@ -106,7 +104,6 @@ class rcube_cache_shared
return $this->cache[$key];
}
/**
* Sets (add/update) value in cache.
*
@ -119,7 +116,6 @@ class rcube_cache_shared
$this->cache_changes[$key] = true;
}
/**
* Returns cached value without storing it in internal memory.
*
@ -136,7 +132,6 @@ class rcube_cache_shared
return $this->read_record($key, true);
}
/**
* Sets (add/update) value in cache and immediately saves
* it in the backend, no internal memory will be used.
@ -151,7 +146,6 @@ class rcube_cache_shared
return $this->write_record($key, $this->serialize($data));
}
/**
* Clears the cache.
*
@ -188,7 +182,6 @@ class rcube_cache_shared
$this->remove_record($key, $prefix_mode);
}
/**
* Remove cache records older than ttl
*/
@ -203,7 +196,6 @@ class rcube_cache_shared
}
}
/**
* Remove expired records of all caches
*/
@ -215,7 +207,6 @@ class rcube_cache_shared
$db->query("DELETE FROM " . $db->table_name('cache_shared', true) . " WHERE `expires` < " . $db->now());
}
/**
* Writes the cache back to the DB.
*/
@ -239,7 +230,6 @@ class rcube_cache_shared
}
}
/**
* Reads cache entry.
*
@ -324,7 +314,6 @@ class rcube_cache_shared
return $this->cache[$key];
}
/**
* Writes single cache record into DB.
*
@ -397,7 +386,6 @@ class rcube_cache_shared
return $this->db->affected_rows($result);
}
/**
* Deletes the cache record(s).
*
@ -460,7 +448,6 @@ class rcube_cache_shared
$this->db->query("DELETE FROM " . $this->table . $where);
}
/**
* Adds entry into memcache/apc DB.
*
@ -493,7 +480,6 @@ class rcube_cache_shared
return $result;
}
/**
* Deletes entry from memcache/apc DB.
*
@ -518,7 +504,6 @@ class rcube_cache_shared
return $result;
}
/**
* Writes the index entry into memcache/apc DB.
*/
@ -548,7 +533,6 @@ class rcube_cache_shared
$this->add_record($this->ikey(), $data);
}
/**
* Gets the index entry from memcache/apc DB.
*/
@ -578,7 +562,6 @@ class rcube_cache_shared
$this->index = $data ? unserialize($data) : array();
}
/**
* Creates cache key name (for memcache and apc)
*
@ -591,7 +574,6 @@ class rcube_cache_shared
return $this->prefix . ':' . $key;
}
/**
* Creates index cache key name (for memcache and apc)
*

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -78,7 +78,6 @@ class rcube_charset
throw new ErrorException($errstr, 0, $errno);
}
/**
* Parse and validate charset name string (see #1485758).
* Sometimes charset string is malformed, there are also charset aliases
@ -159,7 +158,6 @@ class rcube_charset
return $result;
}
/**
* Convert a string from one charset to another.
* Uses mbstring and iconv functions if possible
@ -297,13 +295,12 @@ class rcube_charset
return $str;
}
/**
* Converts string from standard UTF-7 (RFC 2152) to UTF-8.
*
* @param string Input string (UTF-7)
* @param string $str Input string (UTF-7)
*
* @return string Converted string (UTF-8)
* @return string Converted string (UTF-8)
*/
public static function utf7_to_utf8($str)
{
@ -357,13 +354,12 @@ class rcube_charset
return $res;
}
/**
* Converts string from UTF-16 to UTF-8 (helper for utf-7 to utf-8 conversion)
*
* @param string Input string
* @param string $str Input string
*
* @return string The converted string
* @return string The converted string
*/
public static function utf16_to_utf8($str)
{
@ -389,7 +385,6 @@ class rcube_charset
return $dec;
}
/**
* Convert the data ($str) from RFC 2060's UTF-7 to UTF-8.
* If input data is invalid, return the original input string.
@ -498,7 +493,6 @@ class rcube_charset
return $p;
}
/**
* Convert the data ($str) from UTF-8 to RFC 2060's UTF-7.
* Unicode characters above U+FFFF are replaced by U+FFFE.
@ -629,7 +623,6 @@ class rcube_charset
return $p;
}
/**
* A method to guess character set of a string.
*
@ -729,7 +722,6 @@ class rcube_charset
return $failover;
}
/**
* Removes non-unicode characters from input.
*
@ -817,5 +809,4 @@ class rcube_charset
return $out;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2014, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2006-2012, The Roundcube Dev Team |
@ -16,7 +16,6 @@
+-----------------------------------------------------------------------+
*/
/**
* Model class for the local address book database
*
@ -26,40 +25,40 @@
class rcube_contacts extends rcube_addressbook
{
// protected for backward compat. with some plugins
protected $db_name = 'contacts';
protected $db_groups = 'contactgroups';
protected $db_name = 'contacts';
protected $db_groups = 'contactgroups';
protected $db_groupmembers = 'contactgroupmembers';
protected $vcard_fieldmap = array();
protected $vcard_fieldmap = array();
/**
* Store database connection.
*
* @var rcube_db
*/
private $db = null;
private $db = null;
private $user_id = 0;
private $filter = null;
private $result = null;
private $filter = null;
private $result = null;
private $cache;
private $table_cols = array('name', 'email', 'firstname', 'surname');
private $table_cols = array('name', 'email', 'firstname', 'surname');
private $fulltext_cols = array('name', 'firstname', 'surname', 'middlename', 'nickname',
'jobtitle', 'organization', 'department', 'maidenname', 'email', 'phone',
'address', 'street', 'locality', 'zipcode', 'region', 'country', 'website', 'im', 'notes');
'jobtitle', 'organization', 'department', 'maidenname', 'email', 'phone',
'address', 'street', 'locality', 'zipcode', 'region', 'country', 'website', 'im', 'notes');
// public properties
public $primary_key = 'contact_id';
public $name;
public $readonly = false;
public $groups = true;
public $undelete = true;
public $readonly = false;
public $groups = true;
public $undelete = true;
public $list_page = 1;
public $page_size = 10;
public $group_id = 0;
public $ready = false;
public $coltypes = array('name', 'firstname', 'surname', 'middlename', 'prefix', 'suffix', 'nickname',
'jobtitle', 'organization', 'department', 'assistant', 'manager',
'gender', 'maidenname', 'spouse', 'email', 'phone', 'address',
'birthday', 'anniversary', 'website', 'im', 'notes', 'photo');
public $group_id = 0;
public $ready = false;
public $coltypes = array('name', 'firstname', 'surname', 'middlename', 'prefix', 'suffix', 'nickname',
'jobtitle', 'organization', 'department', 'assistant', 'manager',
'gender', 'maidenname', 'spouse', 'email', 'phone', 'address',
'birthday', 'anniversary', 'website', 'im', 'notes', 'photo');
public $date_cols = array('birthday', 'anniversary');
const SEPARATOR = ',';
@ -68,17 +67,16 @@ class rcube_contacts extends rcube_addressbook
/**
* Object constructor
*
* @param object Instance of the rcube_db class
* @param integer User-ID
* @param object $dbconn Instance of the rcube_db class
* @param integer $user User-ID
*/
function __construct($dbconn, $user)
{
$this->db = $dbconn;
$this->db = $dbconn;
$this->user_id = $user;
$this->ready = $this->db && !$this->db->is_error();
$this->ready = $this->db && !$this->db->is_error();
}
/**
* Returns addressbook name
*/
@ -87,7 +85,6 @@ class rcube_contacts extends rcube_addressbook
return $this->name;
}
/**
* Save a search string for future listings
*
@ -99,7 +96,6 @@ class rcube_contacts extends rcube_addressbook
$this->cache = null;
}
/**
* Getter for saved search properties
*
@ -110,7 +106,6 @@ class rcube_contacts extends rcube_addressbook
return $this->filter;
}
/**
* Setter for the current group
* (empty, has to be re-implemented by extending class)
@ -118,10 +113,9 @@ class rcube_contacts extends rcube_addressbook
function set_group($gid)
{
$this->group_id = $gid;
$this->cache = null;
$this->cache = null;
}
/**
* Reset all saved results and search parameters
*/
@ -129,20 +123,19 @@ class rcube_contacts extends rcube_addressbook
{
$this->result = null;
$this->filter = null;
$this->cache = null;
$this->cache = null;
}
/**
* List all active contact groups of this source
*
* @param string Search string to match group name
* @param int Matching mode:
* 0 - partial (*abc*),
* 1 - strict (=),
* 2 - prefix (abc*)
* @param string $search Search string to match group name
* @param int $mode Matching mode:
* 0 - partial (*abc*),
* 1 - strict (=),
* 2 - prefix (abc*)
*
* @return array Indexed list of contact groups, each a hash array
* @return array Indexed list of contact groups, each a hash array
*/
function list_groups($search = null, $mode = 0)
{
@ -180,11 +173,11 @@ class rcube_contacts extends rcube_addressbook
return $results;
}
/**
* Get group properties such as name and email address(es)
*
* @param string Group identifier
* @param string $group_id Group identifier
*
* @return array Group properties as hash array
*/
function get_group($group_id)
@ -208,9 +201,10 @@ class rcube_contacts extends rcube_addressbook
* @param array List of cols to show, Null means all
* @param int Only return this number of records, use negative values for tail
* @param boolean True to skip the count query (select only)
*
* @return array Indexed list of contact records, each a hash array
*/
function list_records($cols=null, $subset=0, $nocount=false)
function list_records($cols = null, $subset = 0, $nocount = false)
{
if ($nocount || $this->list_page <= 1) {
// create dummy result, we don't need a count now
@ -221,13 +215,13 @@ class rcube_contacts extends rcube_addressbook
}
$start_row = $subset < 0 ? $this->result->first + $this->page_size + $subset : $this->result->first;
$length = $subset != 0 ? abs($subset) : $this->page_size;
$length = $subset != 0 ? abs($subset) : $this->page_size;
if ($this->group_id)
$join = " LEFT JOIN " . $this->db->table_name($this->db_groupmembers, true) . " AS m".
" ON (m.`contact_id` = c.`".$this->primary_key."`)";
$order_col = (in_array($this->sort_col, $this->table_cols) ? $this->sort_col : 'name');
$order_col = (in_array($this->sort_col, $this->table_cols) ? $this->sort_col : 'name');
$order_cols = array("c.`$order_col`");
if ($order_col == 'firstname')
$order_cols[] = 'c.`surname`';
@ -284,7 +278,6 @@ class rcube_contacts extends rcube_addressbook
return $this->result;
}
/**
* Search contacts
*
@ -300,15 +293,16 @@ class rcube_contacts extends rcube_addressbook
*
* @return object rcube_result_set Contact records and 'count' value
*/
function search($fields, $value, $mode=0, $select=true, $nocount=false, $required=array())
function search($fields, $value, $mode = 0, $select = true, $nocount = false, $required = array())
{
if (!is_array($required) && !empty($required))
if (!is_array($required) && !empty($required)) {
$required = array($required);
}
$where = $and_where = $post_search = array();
$mode = intval($mode);
$WS = ' ';
$AS = self::SEPARATOR;
$mode = intval($mode);
$WS = ' ';
$AS = self::SEPARATOR;
// direct ID search
if ($fields == 'ID' || $fields == $this->primary_key) {
@ -500,7 +494,6 @@ class rcube_contacts extends rcube_addressbook
return new rcube_result_set($count, ($this->list_page-1) * $this->page_size);
}
/**
* Count number of available contacts in database
*
@ -532,7 +525,6 @@ class rcube_contacts extends rcube_addressbook
return $this->cache['count'];
}
/**
* Return the last result set
*
@ -543,18 +535,20 @@ class rcube_contacts extends rcube_addressbook
return $this->result;
}
/**
* Get a specific contact record
*
* @param mixed record identifier(s)
* @param mixed $id Record identifier(s)
* @param bool $assoc Enables returning associative array
*
* @return mixed Result object with all record fields or False if not found
*/
function get_record($id, $assoc=false)
function get_record($id, $assoc = false)
{
// return cached result
if ($this->result && ($first = $this->result->first()) && $first[$this->primary_key] == $id)
if ($this->result && ($first = $this->result->first()) && $first[$this->primary_key] == $id) {
return $assoc ? $first : $this->result;
}
$this->db->query(
"SELECT * FROM " . $this->db->table_name($this->db_name, true).
@ -574,42 +568,44 @@ class rcube_contacts extends rcube_addressbook
return $assoc && $record ? $record : $this->result;
}
/**
* Get group assignments of a specific contact record
*
* @param mixed Record identifier
* @param mixed $id Record identifier
*
* @return array List of assigned groups as ID=>Name pairs
*/
function get_record_groups($id)
{
$results = array();
if (!$this->groups)
return $results;
$sql_result = $this->db->query(
"SELECT cgm.`contactgroup_id`, cg.`name` "
. " FROM " . $this->db->table_name($this->db_groupmembers, true) . " AS cgm"
. " LEFT JOIN " . $this->db->table_name($this->db_groups, true) . " AS cg"
. " ON (cgm.`contactgroup_id` = cg.`contactgroup_id` AND cg.`del` <> 1)"
. " WHERE cgm.`contact_id` = ?",
$id
);
while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) {
$results[$sql_arr['contactgroup_id']] = $sql_arr['name'];
}
return $results;
}
$results = array();
if (!$this->groups) {
return $results;
}
$sql_result = $this->db->query(
"SELECT cgm.`contactgroup_id`, cg.`name` "
. " FROM " . $this->db->table_name($this->db_groupmembers, true) . " AS cgm"
. " LEFT JOIN " . $this->db->table_name($this->db_groups, true) . " AS cg"
. " ON (cgm.`contactgroup_id` = cg.`contactgroup_id` AND cg.`del` <> 1)"
. " WHERE cgm.`contact_id` = ?",
$id
);
while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) {
$results[$sql_arr['contactgroup_id']] = $sql_arr['name'];
}
return $results;
}
/**
* Check the given data before saving.
* If input not valid, the message to display can be fetched using get_error()
*
* @param array Assoziative array with data to save
* @param boolean Try to fix/complete record automatically
* @param array $save_data Associative array with data to save
* @param boolean $autofix Try to fix/complete record automatically
*
* @return boolean True if input is valid, False if not.
*/
public function validate(&$save_data, $autofix = false)
@ -626,17 +622,19 @@ class rcube_contacts extends rcube_addressbook
return $valid;
}
/**
* Create a new contact record
*
* @param array Associative array with save data
* @param array $save_data Associative array with save data
* @param bool $check Enables validity checks
*
* @return integer|boolean The created record ID on success, False on error
*/
function insert($save_data, $check=false)
function insert($save_data, $check = false)
{
if (!is_array($save_data))
if (!is_array($save_data)) {
return false;
}
$insert_id = $existing = false;
@ -674,12 +672,11 @@ class rcube_contacts extends rcube_addressbook
return $insert_id;
}
/**
* Update a specific contact record
*
* @param mixed Record identifier
* @param array Assoziative array with save data
* @param mixed $id Record identifier
* @param array $save_cols Associative array with save data
*
* @return boolean True on success, False on error
*/
@ -712,7 +709,9 @@ class rcube_contacts extends rcube_addressbook
return $updated ? true : false;
}
/**
* Convert data stored in the database into output format
*/
private function convert_db_data($sql_arr)
{
$record = array();
@ -732,7 +731,9 @@ class rcube_contacts extends rcube_addressbook
return $record;
}
/**
* Convert input data for storing in the database
*/
private function convert_save_data($save_data, $record = array())
{
$out = array();
@ -785,17 +786,17 @@ class rcube_contacts extends rcube_addressbook
return $out;
}
/**
* Mark one or more contact records as deleted
*
* @param array Record identifiers
* @param boolean Remove record(s) irreversible (unsupported)
* @param array $ids Record identifiers
* @param boolean $force Remove record(s) irreversible (unsupported)
*/
function delete($ids, $force=true)
function delete($ids, $force = true)
{
if (!is_array($ids))
if (!is_array($ids)) {
$ids = explode(self::SEPARATOR, $ids);
}
$ids = $this->db->array2list($ids, 'integer');
@ -813,16 +814,16 @@ class rcube_contacts extends rcube_addressbook
return $this->db->affected_rows();
}
/**
* Undelete one or more contact records
*
* @param array Record identifiers
* @param array $ids Record identifiers
*/
function undelete($ids)
{
if (!is_array($ids))
if (!is_array($ids)) {
$ids = explode(self::SEPARATOR, $ids);
}
$ids = $this->db->array2list($ids, 'integer');
@ -840,7 +841,6 @@ class rcube_contacts extends rcube_addressbook
return $this->db->affected_rows();
}
/**
* Remove all records from the database
*
@ -871,11 +871,11 @@ class rcube_contacts extends rcube_addressbook
return $count;
}
/**
* Create a contact group with the given name
*
* @param string The group name
* @param string $name The group name
*
* @return mixed False on error, array with record props in success
*/
function create_group($name)
@ -898,11 +898,11 @@ class rcube_contacts extends rcube_addressbook
return $result;
}
/**
* Delete the given group (and all linked group members)
*
* @param string Group identifier
* @param string $gid Group identifier
*
* @return boolean True on success, false if no data was changed
*/
function delete_group($gid)
@ -924,14 +924,16 @@ class rcube_contacts extends rcube_addressbook
/**
* Rename a specific contact group
*
* @param string Group identifier
* @param string New name to set for this group
* @param string $gid Group identifier
* @param string $name New name to set for this group
* @param string $new_gid (not used)
*
* @return boolean New name on success, false if no data was changed
*/
function rename_group($gid, $newname, &$new_gid)
function rename_group($gid, $name, &$new_gid)
{
// make sure we have a unique name
$name = $this->unique_groupname($newname);
$name = $this->unique_groupname($name);
$sql_result = $this->db->query(
"UPDATE " . $this->db->table_name($this->db_groups, true).
@ -944,7 +946,6 @@ class rcube_contacts extends rcube_addressbook
return $this->db->affected_rows($sql_result) ? $name : false;
}
/**
* Add the given contact records the a certain group
*
@ -955,10 +956,11 @@ class rcube_contacts extends rcube_addressbook
*/
function add_to_group($group_id, $ids)
{
if (!is_array($ids))
if (!is_array($ids)) {
$ids = explode(self::SEPARATOR, $ids);
}
$added = 0;
$added = 0;
$exists = array();
// get existing assignments ...
@ -968,9 +970,11 @@ class rcube_contacts extends rcube_addressbook
" AND `contact_id` IN (".$this->db->array2list($ids, 'integer').")",
$group_id
);
while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) {
$exists[] = $sql_arr['contact_id'];
}
// ... and remove them from the list
$ids = array_diff($ids, $exists);
@ -983,16 +987,17 @@ class rcube_contacts extends rcube_addressbook
$contact_id
);
if ($error = $this->db->is_error())
if ($error = $this->db->is_error()) {
$this->set_error(self::ERROR_SAVING, $error);
else
}
else {
$added++;
}
}
return $added;
}
/**
* Remove the given contact records from a certain group
*
@ -1018,17 +1023,18 @@ class rcube_contacts extends rcube_addressbook
return $this->db->affected_rows($sql_result);
}
/**
* Check for existing groups with the same name
*
* @param string Name to check
* @param string $name Name to check
*
* @return string A group name which is unique for the current use
*/
private function unique_groupname($name)
{
$checkname = $name;
$num = 2; $hit = false;
$num = 2;
$hit = false;
do {
$sql_result = $this->db->query(
@ -1043,7 +1049,8 @@ class rcube_contacts extends rcube_addressbook
if ($hit = $this->db->fetch_array($sql_result)) {
$checkname = $name . ' ' . $num++;
}
} while ($hit);
}
while ($hit);
return $checkname;
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2011, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2012, The Roundcube Dev Team |
@ -394,7 +394,9 @@ class rcube_csv2vcard
}
/**
* Import contacts from CSV file
*
* @param string $csv Content of the CSV file
*/
public function import($csv)
{
@ -457,6 +459,8 @@ class rcube_csv2vcard
}
/**
* Export vCards
*
* @return array rcube_vcard List of vcards
*/
public function export()

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2011-2014, Kolab Systems AG |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -127,6 +127,13 @@ class rcube_enriched
return $body;
}
/**
* Converts Enriched text into HTML format
*
* @param string $body Enriched text
*
* @return string HTML text
*/
public static function to_html($body)
{
$body = str_replace('<<','&lt;',$body);

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -41,6 +41,11 @@ class rcube_image
);
/**
* Class constructor
*
* @param string $filename Image file name/path
*/
function __construct($filename)
{
$this->image_file = $filename;

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -95,7 +95,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Magic getter for backward compat.
*
@ -108,7 +107,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Connect to an IMAP server
*
@ -203,7 +201,6 @@ class rcube_imap extends rcube_storage
return false;
}
/**
* Close IMAP connection.
* Usually done on script shutdown
@ -216,7 +213,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Check connection state, connect if not connected.
*
@ -238,7 +234,6 @@ class rcube_imap extends rcube_storage
return $this->is_connected();
}
/**
* Checks IMAP connection.
*
@ -249,7 +244,6 @@ class rcube_imap extends rcube_storage
return $this->conn->connected();
}
/**
* Returns code of last error
*
@ -260,7 +254,6 @@ class rcube_imap extends rcube_storage
return $this->conn->errornum;
}
/**
* Returns text of last error
*
@ -271,7 +264,6 @@ class rcube_imap extends rcube_storage
return $this->conn->error;
}
/**
* Returns code of last command response
*
@ -301,7 +293,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Activate/deactivate debug mode
*
@ -313,23 +304,21 @@ class rcube_imap extends rcube_storage
$this->conn->setDebug($dbg, array($this, 'debug_handler'));
}
/**
* Set internal folder reference.
* All operations will be perfomed on this folder.
*
* @param string $folder Folder name
* @param string $folder Folder name
*/
public function set_folder($folder)
{
$this->folder = $folder;
}
/**
* Save a search result for future message listing methods
*
* @param array $set Search set, result from rcube_imap::get_search_set():
* @param array $set Search set, result from rcube_imap::get_search_set():
* 0 - searching criteria, string
* 1 - search result, rcube_result_index|rcube_result_thread
* 2 - searching character set, string
@ -352,7 +341,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Return the saved search set as hash array
*
@ -373,7 +361,6 @@ class rcube_imap extends rcube_storage
);
}
/**
* Returns the IMAP server's capability.
*
@ -397,14 +384,13 @@ class rcube_imap extends rcube_storage
return $_SESSION[$sess_key];
}
/**
* Checks the PERMANENTFLAGS capability of the current folder
* and returns true if the given flag is supported by the IMAP server
*
* @param string $flag Permanentflag name
* @param string $flag Permanentflag name
*
* @return boolean True if this flag is supported
* @return boolean True if this flag is supported
*/
public function check_permflag($flag)
{
@ -415,11 +401,10 @@ class rcube_imap extends rcube_storage
return $imap_flag && !empty($perm_flags) && in_array_nocase($imap_flag, $perm_flags);
}
/**
* Returns PERMANENTFLAGS of the specified folder
*
* @param string $folder Folder name
* @param string $folder Folder name
*
* @return array Flags
*/
@ -447,25 +432,22 @@ class rcube_imap extends rcube_storage
return $permflags;
}
/**
* Returns the delimiter that is used by the IMAP server for folder separation
*
* @return string Delimiter string
* @access public
* @return string Delimiter string
*/
public function get_hierarchy_delimiter()
{
return $this->delimiter;
}
/**
* Get namespace
*
* @param string $name Namespace array index: personal, other, shared, prefix
*
* @return array Namespace data
* @return array Namespace data
*/
public function get_namespace($name = null)
{
@ -479,7 +461,6 @@ class rcube_imap extends rcube_storage
return $ns;
}
/**
* Sets delimiter and namespaces
*/
@ -560,7 +541,6 @@ class rcube_imap extends rcube_storage
$_SESSION['imap_delimiter'] = $this->delimiter;
}
/**
* Get message count for a specific folder
*
@ -570,7 +550,7 @@ class rcube_imap extends rcube_storage
* @param boolean $status Enables storing folder status info (max UID/count),
* required for folder_status()
*
* @return int Number of messages
* @return int Number of messages
*/
public function count($folder='', $mode='ALL', $force=false, $status=true)
{
@ -581,7 +561,6 @@ class rcube_imap extends rcube_storage
return $this->countmessages($folder, $mode, $force, $status);
}
/**
* protected method for getting nr of messages
*
@ -696,7 +675,6 @@ class rcube_imap extends rcube_storage
return (int)$count;
}
/**
* Public method for listing message flags
*
@ -731,7 +709,6 @@ class rcube_imap extends rcube_storage
return $result;
}
/**
* Public method for listing headers
*
@ -741,7 +718,7 @@ class rcube_imap extends rcube_storage
* @param string $sort_order Sort order [ASC|DESC]
* @param int $slice Number of slice items to extract from result array
*
* @return array Indexed array with message header objects
* @return array Indexed array with message header objects
*/
public function list_messages($folder='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0)
{
@ -752,7 +729,6 @@ class rcube_imap extends rcube_storage
return $this->_list_messages($folder, $page, $sort_field, $sort_order, $slice);
}
/**
* protected method for listing message headers
*
@ -762,8 +738,8 @@ class rcube_imap extends rcube_storage
* @param string $sort_order Sort order [ASC|DESC]
* @param int $slice Number of slice items to extract from result array
*
* @return array Indexed array with message header objects
* @see rcube_imap::list_messages
* @return array Indexed array with message header objects
* @see rcube_imap::list_messages
*/
protected function _list_messages($folder='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0)
{
@ -806,16 +782,15 @@ class rcube_imap extends rcube_storage
return array_values($a_msg_headers);
}
/**
* protected method for listing message headers using threads
*
* @param string $folder Folder name
* @param int $page Current page to list
* @param int $slice Number of slice items to extract from result array
* @param string $folder Folder name
* @param int $page Current page to list
* @param int $slice Number of slice items to extract from result array
*
* @return array Indexed array with message header objects
* @see rcube_imap::list_messages
* @return array Indexed array with message header objects
* @see rcube_imap::list_messages
*/
protected function list_thread_messages($folder, $page, $slice=0)
{
@ -833,7 +808,7 @@ class rcube_imap extends rcube_storage
/**
* Method for fetching threads data
*
* @param string $folder Folder name
* @param string $folder Folder name
*
* @return rcube_imap_thread Thread data object
*/
@ -857,11 +832,10 @@ class rcube_imap extends rcube_storage
return $this->icache['threads'] = $result;
}
/**
* Method for direct fetching of threads data
*
* @param string $folder Folder name
* @param string $folder Folder name
*
* @return rcube_imap_thread Thread data object
*/
@ -876,7 +850,6 @@ class rcube_imap extends rcube_storage
$this->options['skip_deleted'] ? 'UNDELETED' : '', true);
}
/**
* protected method for fetching threaded messages headers
*
@ -885,7 +858,7 @@ class rcube_imap extends rcube_storage
* @param int $page List page number
* @param int $slice Number of threads to slice
*
* @return array Messages headers
* @return array Messages headers
*/
protected function fetch_thread_headers($folder, $threads, $page, $slice=0)
{
@ -915,13 +888,12 @@ class rcube_imap extends rcube_storage
return array_values($a_msg_headers);
}
/**
* protected method for setting threaded messages flags:
* depth, has_children and unread_children
*
* @param array $headers Reference to headers array indexed by message UID
* @param rcube_result_thread $threads Threads data object
* @param array $headers Reference to headers array indexed by message UID
* @param rcube_result_thread $threads Threads data object
*
* @return array Message headers array indexed by message UID
*/
@ -947,7 +919,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* protected method for listing a set of message headers (search results)
*
@ -955,7 +926,7 @@ class rcube_imap extends rcube_storage
* @param int $page Current page to list
* @param int $slice Number of slice items to extract from result array
*
* @return array Indexed array with message header objects
* @return array Indexed array with message header objects
*/
protected function list_search_messages($folder, $page, $slice=0)
{
@ -1140,7 +1111,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* protected method for listing a set of threaded message headers (search results)
*
@ -1148,7 +1118,7 @@ class rcube_imap extends rcube_storage
* @param int $page Current page to list
* @param int $slice Number of slice items to extract from result array
*
* @return array Indexed array with message header objects
* @return array Indexed array with message header objects
* @see rcube_imap::list_search_messages()
*/
protected function list_search_thread_messages($folder, $page, $slice=0)
@ -1164,7 +1134,6 @@ class rcube_imap extends rcube_storage
return $this->fetch_thread_headers($folder, clone $this->search_set, $page, $slice);
}
/**
* Fetches messages headers (by UID)
*
@ -1212,7 +1181,6 @@ class rcube_imap extends rcube_storage
return $a_msg_headers;
}
/**
* Returns current status of a folder (compared to the last time use)
*
@ -1260,7 +1228,6 @@ class rcube_imap extends rcube_storage
return $result;
}
/**
* Stores folder statistic data in session
* @TODO: move to separate DB table (cache?)
@ -1274,7 +1241,6 @@ class rcube_imap extends rcube_storage
$_SESSION['folders'][$folder][$name] = $data;
}
/**
* Gets folder statistic data
*
@ -1291,7 +1257,6 @@ class rcube_imap extends rcube_storage
return array();
}
/**
* Return sorted list of message UIDs
*
@ -1369,7 +1334,6 @@ class rcube_imap extends rcube_storage
return $this->index_direct($folder, $this->sort_field, $this->sort_order);
}
/**
* Return sorted list of message UIDs ignoring current search settings.
* Doesn't uses cache by default.
@ -1437,7 +1401,6 @@ class rcube_imap extends rcube_storage
return $index;
}
/**
* Return index of threaded message UIDs
*
@ -1468,7 +1431,6 @@ class rcube_imap extends rcube_storage
return $threads;
}
/**
* Sort threaded result, using THREAD=REFS method if available.
* If not, use any method and re-sort the result in THREAD=REFS way.
@ -1498,7 +1460,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Invoke search request to IMAP server
*
@ -1574,7 +1535,6 @@ class rcube_imap extends rcube_storage
return $results;
}
/**
* Direct (real and simple) SEARCH request (without result sorting and caching).
*
@ -1609,7 +1569,6 @@ class rcube_imap extends rcube_storage
return $index;
}
/**
* protected search method
*
@ -1686,7 +1645,6 @@ class rcube_imap extends rcube_storage
return $messages;
}
/**
* Converts charset of search criteria string
*
@ -1726,7 +1684,6 @@ class rcube_imap extends rcube_storage
return $res;
}
/**
* Refresh saved search set
*
@ -1759,7 +1716,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Return message headers object of a specific message
*
@ -1798,7 +1754,6 @@ class rcube_imap extends rcube_storage
return $headers;
}
/**
* Fetch message headers and body structure from the IMAP server and build
* an object structure similar to the one generated by PEAR::Mail_mimeDecode
@ -1924,7 +1879,6 @@ class rcube_imap extends rcube_storage
return $this->icache['message'] = $headers;
}
/**
* Build message part object
*
@ -1932,7 +1886,7 @@ class rcube_imap extends rcube_storage
* @param int $count
* @param string $parent
*/
protected function structure_part($part, $count=0, $parent='', $mime_headers=null)
protected function structure_part($part, $count = 0, $parent = '', $mime_headers = null)
{
$struct = new rcube_message_part;
$struct->mime_id = empty($parent) ? (string)$count : "$parent.$count";
@ -2150,14 +2104,13 @@ class rcube_imap extends rcube_storage
return $struct;
}
/**
* Set attachment filename from message part structure
*
* @param rcube_message_part $part Part object
* @param string $headers Part's raw headers
* @param rcube_message_part $part Part object
* @param string $headers Part's raw headers
*/
protected function set_part_filename(&$part, $headers=null)
protected function set_part_filename(&$part, $headers = null)
{
if (!empty($part->d_parameters['filename'])) {
$filename_mime = $part->d_parameters['filename'];
@ -2285,11 +2238,10 @@ class rcube_imap extends rcube_storage
}
}
/**
* Get charset name from message structure (first part)
*
* @param array $structure Message structure
* @param array $structure Message structure
*
* @return string Charset name
*/
@ -2318,7 +2270,8 @@ class rcube_imap extends rcube_storage
*
* @return string Message/part body if not printed
*/
public function get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL, $skip_charset_conv=false, $max_bytes=0, $formatted=true)
public function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null,
$skip_charset_conv = false, $max_bytes = 0, $formatted = true)
{
if (!$this->check_connection()) {
return null;
@ -2370,7 +2323,6 @@ class rcube_imap extends rcube_storage
return $body;
}
/**
* Returns the whole message source as string (or saves to a file)
*
@ -2390,7 +2342,6 @@ class rcube_imap extends rcube_storage
true, $part, null, false, $fp);
}
/**
* Returns the message headers as string
*
@ -2408,7 +2359,6 @@ class rcube_imap extends rcube_storage
return $this->conn->fetchPartHeader($this->folder, $uid, true, $part);
}
/**
* Sends the whole message source to stdout
*
@ -2424,7 +2374,6 @@ class rcube_imap extends rcube_storage
$this->conn->handlePartBody($this->folder, $uid, true, null, null, true, null, $formatted);
}
/**
* Set message flag to one or several messages
*
@ -2484,7 +2433,6 @@ class rcube_imap extends rcube_storage
return $result;
}
/**
* Append a mail message (source) to a specific folder
*
@ -2542,7 +2490,6 @@ class rcube_imap extends rcube_storage
return $saved;
}
/**
* Move a message from one folder to another
*
@ -2620,7 +2567,6 @@ class rcube_imap extends rcube_storage
return $moved;
}
/**
* Copy a message from one folder to another
*
@ -2657,7 +2603,6 @@ class rcube_imap extends rcube_storage
return $copied;
}
/**
* Mark messages as deleted and expunge them
*
@ -2715,7 +2660,6 @@ class rcube_imap extends rcube_storage
return $deleted;
}
/**
* Send IMAP expunge command and clear cache
*
@ -2838,15 +2782,14 @@ class rcube_imap extends rcube_storage
return $a_mboxes;
}
/**
* Method for direct folders listing (LSUB)
*
* @param string $root Optional root folder
* @param string $name Optional name pattern
* @param string $root Optional root folder
* @param string $name Optional name pattern
*
* @return array List of subscribed folders
* @see rcube_imap::list_folders_subscribed()
* @return array List of subscribed folders
* @see rcube_imap::list_folders_subscribed()
*/
public function list_folders_subscribed_direct($root='', $name='*')
{
@ -2907,7 +2850,6 @@ class rcube_imap extends rcube_storage
return $a_folders;
}
/**
* Get a list of all folders available on the server
*
@ -2976,15 +2918,14 @@ class rcube_imap extends rcube_storage
return $a_mboxes;
}
/**
* Method for direct folders listing (LIST)
*
* @param string $root Optional root folder
* @param string $name Optional name pattern
* @param string $root Optional root folder
* @param string $name Optional name pattern
*
* @return array List of folders
* @see rcube_imap::list_folders()
* @return array List of folders
* @see rcube_imap::list_folders()
*/
public function list_folders_direct($root='', $name='*')
{
@ -3008,13 +2949,12 @@ class rcube_imap extends rcube_storage
return $result;
}
/**
* Fix folders list by adding folders from other namespaces.
* Needed on some servers eg. Courier IMAP
*
* @param array $result Reference to folders list
* @param string $type Listing type (ext-subscribed, subscribed or all)
* @param array $result Reference to folders list
* @param string $type Listing type (ext-subscribed, subscribed or all)
*/
protected function list_folders_update(&$result, $type = null)
{
@ -3064,7 +3004,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Filter the given list of folders according to access rights
*
@ -3090,7 +3029,6 @@ class rcube_imap extends rcube_storage
return $a_folders;
}
/**
* Get mailbox quota information
*
@ -3107,7 +3045,6 @@ class rcube_imap extends rcube_storage
return false;
}
/**
* Get folder size (size of all messages in a folder)
*
@ -3131,7 +3068,6 @@ class rcube_imap extends rcube_storage
return $result;
}
/**
* Subscribe to a specific folder(s)
*
@ -3145,7 +3081,6 @@ class rcube_imap extends rcube_storage
return $this->change_subscription($folders, 'subscribe');
}
/**
* Unsubscribe folder(s)
*
@ -3159,7 +3094,6 @@ class rcube_imap extends rcube_storage
return $this->change_subscription($folders, 'unsubscribe');
}
/**
* Create a new folder on the server and register it in local cache
*
@ -3200,7 +3134,6 @@ class rcube_imap extends rcube_storage
return $result;
}
/**
* Set a new name to an existing folder
*
@ -3260,7 +3193,6 @@ class rcube_imap extends rcube_storage
return $result;
}
/**
* Remove folder from server
*
@ -3308,7 +3240,6 @@ class rcube_imap extends rcube_storage
return $result;
}
/**
* Detect special folder associations stored in storage backend
*/
@ -3353,7 +3284,6 @@ class rcube_imap extends rcube_storage
return array_merge($result, $special);
}
/**
* Set special folder associations stored in storage backend
*/
@ -3392,7 +3322,6 @@ class rcube_imap extends rcube_storage
return true;
}
/**
* Checks if folder exists and is subscribed
*
@ -3446,7 +3375,6 @@ class rcube_imap extends rcube_storage
return false;
}
/**
* Returns the namespace where the folder is in
*
@ -3477,7 +3405,6 @@ class rcube_imap extends rcube_storage
return 'personal';
}
/**
* Modify folder name according to namespace.
* For output it removes prefix of the personal namespace if it's possible.
@ -3516,7 +3443,6 @@ class rcube_imap extends rcube_storage
return $folder;
}
/**
* Gets folder attributes from LIST response, e.g. \Noselect, \Noinferiors
*
@ -3549,7 +3475,6 @@ class rcube_imap extends rcube_storage
return is_array($opts) ? $opts : array();
}
/**
* Gets connection (and current folder) data: UIDVALIDITY, EXISTS, RECENT,
* PERMANENTFLAGS, UIDNEXT, UNSEEN
@ -3589,7 +3514,6 @@ class rcube_imap extends rcube_storage
return $data;
}
/**
* Returns extended information about the folder
*
@ -3685,7 +3609,6 @@ class rcube_imap extends rcube_storage
return $options;
}
/**
* Synchronizes messages cache.
*
@ -3698,7 +3621,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Get message header names for rcube_imap_generic::fetchHeader(s)
*
@ -3750,7 +3672,6 @@ class rcube_imap extends rcube_storage
return $this->conn->setACL($folder, $user, $acl);
}
/**
* Removes any <identifier,rights> pair for the
* specified user from the ACL for the specified
@ -3775,7 +3696,6 @@ class rcube_imap extends rcube_storage
return $this->conn->deleteACL($folder, $user);
}
/**
* Returns the access control list for folder (GETACL)
*
@ -3797,7 +3717,6 @@ class rcube_imap extends rcube_storage
return $this->conn->getACL($folder);
}
/**
* Returns information about what rights can be granted to the
* user (identifier) in the ACL for the folder (LISTRIGHTS)
@ -3821,7 +3740,6 @@ class rcube_imap extends rcube_storage
return $this->conn->listRights($folder, $user);
}
/**
* Returns the set of rights that the current user has to
* folder (MYRIGHTS)
@ -3844,7 +3762,6 @@ class rcube_imap extends rcube_storage
return $this->conn->myRights($folder);
}
/**
* Sets IMAP metadata/annotations (SETMETADATA/SETANNOTATION)
*
@ -3878,7 +3795,6 @@ class rcube_imap extends rcube_storage
return false;
}
/**
* Unsets IMAP metadata/annotations (SETMETADATA/SETANNOTATION)
*
@ -3912,7 +3828,6 @@ class rcube_imap extends rcube_storage
return false;
}
/**
* Returns IMAP metadata/annotations (GETMETADATA/GETANNOTATION)
*
@ -3985,7 +3900,6 @@ class rcube_imap extends rcube_storage
return null;
}
/**
* Converts the METADATA extension entry name into the correct
* entry-attrib names for older ANNOTATEMORE version.
@ -4115,7 +4029,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Getter for messages cache object
*/
@ -4134,7 +4047,6 @@ class rcube_imap extends rcube_storage
return $this->mcache;
}
/**
* Clears the messages cache.
*
@ -4148,7 +4060,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Delete outdated cache entries
*/
@ -4178,7 +4089,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Sort folders first by default folders and then in alphabethical order
*
@ -4265,12 +4175,11 @@ class rcube_imap extends rcube_storage
}
}
/**
* Find UID of the specified message sequence ID
*
* @param int $id Message (sequence) ID
* @param string $folder Folder name
* @param int $id Message (sequence) ID
* @param string $folder Folder name
*
* @return int Message UID
*/
@ -4295,7 +4204,6 @@ class rcube_imap extends rcube_storage
return $uid;
}
/**
* Subscribe/unsubscribe a list of folders and update local cache
*/
@ -4328,7 +4236,6 @@ class rcube_imap extends rcube_storage
return $updated;
}
/**
* Increde/decrese messagecount for a specific folder
*/
@ -4359,7 +4266,6 @@ class rcube_imap extends rcube_storage
return true;
}
/**
* Remove messagecount of a specific folder from cache
*/
@ -4378,7 +4284,6 @@ class rcube_imap extends rcube_storage
}
}
/**
* Converts date string/object into IMAP date/time format
*/
@ -4401,7 +4306,6 @@ class rcube_imap extends rcube_storage
return $date->format('d-M-Y H:i:s O');
}
/**
* This is our own debug handler for the IMAP connection
* @access public
@ -4531,7 +4435,7 @@ class rcube_imap extends rcube_storage
return $this->mod_folder($folder, $mode);
}
public function mailbox_attributes($folder, $force=false)
public function mailbox_attributes($folder, $force = false)
{
return $this->folder_attributes($folder, $force);
}
@ -4551,9 +4455,8 @@ class rcube_imap extends rcube_storage
return $this->folder_sync($folder);
}
public function expunge($folder='', $clear_cache=true)
public function expunge($folder = '', $clear_cache = true)
{
return $this->expunge_folder($folder, $clear_cache);
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -99,7 +99,6 @@ class rcube_imap_cache
);
/**
* Object constructor.
*
@ -132,7 +131,6 @@ class rcube_imap_cache
$this->messages_table = $db->table_name('cache_messages', true);
}
/**
* Cleanup actions (on shutdown).
*/
@ -142,7 +140,6 @@ class rcube_imap_cache
$this->icache = null;
}
/**
* Set cache mode
*
@ -153,7 +150,6 @@ class rcube_imap_cache
$this->mode = $mode;
}
/**
* Return (sorted) messages index (UIDs).
* If index doesn't exist or is invalid, will be updated.
@ -262,7 +258,6 @@ class rcube_imap_cache
return $data;
}
/**
* Return messages thread.
* If threaded index doesn't exist or is invalid, will be updated.
@ -318,7 +313,6 @@ class rcube_imap_cache
return $index['object'];
}
/**
* Returns list of messages (headers). See rcube_imap::fetch_headers().
*
@ -381,7 +375,6 @@ class rcube_imap_cache
return $result;
}
/**
* Returns message data.
*
@ -449,7 +442,6 @@ class rcube_imap_cache
return $message;
}
/**
* Saves the message in cache.
*
@ -522,7 +514,6 @@ class rcube_imap_cache
$this->db->set_option('ignore_key_errors', false);
}
/**
* Sets the flag for specified message.
*
@ -575,7 +566,6 @@ class rcube_imap_cache
$this->userid, $mailbox);
}
/**
* Removes message(s) from cache.
*
@ -612,7 +602,6 @@ class rcube_imap_cache
}
}
/**
* Clears index cache.
*
@ -652,7 +641,6 @@ class rcube_imap_cache
}
}
/**
* Clears thread cache.
*
@ -677,7 +665,6 @@ class rcube_imap_cache
}
}
/**
* Clears the cache.
*
@ -691,7 +678,6 @@ class rcube_imap_cache
$this->remove_message($mailbox, $uids);
}
/**
* Delete expired cache entries
*/
@ -711,7 +697,6 @@ class rcube_imap_cache
." WHERE `expires` < $now");
}
/**
* Fetches index data from database
*/
@ -748,7 +733,6 @@ class rcube_imap_cache
return null;
}
/**
* Fetches thread data from database
*/
@ -782,7 +766,6 @@ class rcube_imap_cache
return null;
}
/**
* Saves index data into database
*/
@ -836,7 +819,6 @@ class rcube_imap_cache
$this->db->set_option('ignore_key_errors', false);
}
/**
* Saves thread data into database
*/
@ -887,7 +869,6 @@ class rcube_imap_cache
$this->db->set_option('ignore_key_errors', false);
}
/**
* Checks index/thread validity
*/
@ -1013,7 +994,6 @@ class rcube_imap_cache
return true;
}
/**
* Synchronizes the mailbox.
*
@ -1190,7 +1170,6 @@ class rcube_imap_cache
$this->icache[$mailbox]['index']['object'] = $data;
}
/**
* Converts cache row into message object.
*
@ -1214,7 +1193,6 @@ class rcube_imap_cache
return $message;
}
/**
* Saves message stored in internal cache
*/
@ -1236,7 +1214,6 @@ class rcube_imap_cache
}
}
/**
* Prepares message object to be stored in database.
*
@ -1276,7 +1253,6 @@ class rcube_imap_cache
}
}
/**
* Fetches index data from IMAP server
*/
@ -1297,7 +1273,6 @@ class rcube_imap_cache
return $index;
}
/**
* Fetches thread data from IMAP server
*/
@ -1314,7 +1289,6 @@ class rcube_imap_cache
return new rcube_result_thread($mailbox, '* THREAD');
}
}
// for backward compat.

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2006-2013, The Roundcube Dev Team |
@ -239,10 +239,9 @@ class rcube_ldap extends rcube_addressbook
$this->_connect();
}
/**
* Establish a connection to the LDAP server
*/
* Establish a connection to the LDAP server
*/
private function _connect()
{
$rcube = rcube::get_instance();
@ -439,7 +438,6 @@ class rcube_ldap extends rcube_addressbook
return $this->ready;
}
/**
* Close connection to LDAP server
*/
@ -450,7 +448,6 @@ class rcube_ldap extends rcube_addressbook
}
}
/**
* Returns address book name
*
@ -461,7 +458,6 @@ class rcube_ldap extends rcube_addressbook
return $this->prop['name'];
}
/**
* Set internal list page
*
@ -484,7 +480,6 @@ class rcube_ldap extends rcube_addressbook
$this->ldap->set_vlv_page($this->list_page, $this->page_size);
}
/**
* Set internal sort settings
*
@ -497,7 +492,6 @@ class rcube_ldap extends rcube_addressbook
$this->sort_col = $this->coltypes[$sort_col]['attributes'][0];
}
/**
* Save a search string for future listings
*
@ -508,7 +502,6 @@ class rcube_ldap extends rcube_addressbook
$this->filter = $filter;
}
/**
* Getter for saved search properties
*
@ -519,7 +512,6 @@ class rcube_ldap extends rcube_addressbook
return $this->filter;
}
/**
* Reset all saved results and search parameters
*/
@ -530,14 +522,13 @@ class rcube_ldap extends rcube_addressbook
$this->filter = '';
}
/**
* List the current set of contact records
*
* @param array List of cols to show
* @param int Only return this number of records
* @param array List of cols to show
* @param int Only return this number of records
*
* @return array Indexed list of contact records, each a hash array
* @return array Indexed list of contact records, each a hash array
*/
function list_records($cols=null, $subset=0)
{
@ -736,7 +727,6 @@ class rcube_ldap extends rcube_addressbook
return strcmp($a[$this->sort_col][0], $b[$this->sort_col][0]);
}
/**
* Search contacts
*
@ -892,7 +882,6 @@ class rcube_ldap extends rcube_addressbook
return $this->result;
}
/**
* Count number of available contacts in database
*
@ -921,7 +910,6 @@ class rcube_ldap extends rcube_addressbook
return new rcube_result_set($count, ($this->list_page-1) * $this->page_size);
}
/**
* Return the last result set
*
@ -990,7 +978,6 @@ class rcube_ldap extends rcube_addressbook
return $err;
}
/**
* Check the given data before saving.
* If input not valid, the message to display can be fetched using get_error()
@ -1062,7 +1049,6 @@ class rcube_ldap extends rcube_addressbook
return true;
}
/**
* Create a new contact record
*
@ -1132,7 +1118,6 @@ class rcube_ldap extends rcube_addressbook
return $dn;
}
/**
* Update a specific contact record
*
@ -1314,7 +1299,6 @@ class rcube_ldap extends rcube_addressbook
return $newdn ? $newdn : true;
}
/**
* Mark one or more contact records as deleted
*
@ -1364,7 +1348,6 @@ class rcube_ldap extends rcube_addressbook
return count($ids);
}
/**
* Remove all contact records
*
@ -1433,7 +1416,6 @@ class rcube_ldap extends rcube_addressbook
}
}
/**
* Converts LDAP entry into an array
*/
@ -1492,7 +1474,6 @@ class rcube_ldap extends rcube_addressbook
return $out;
}
/**
* Return LDAP attribute(s) for the given field
*/
@ -1501,7 +1482,6 @@ class rcube_ldap extends rcube_addressbook
return (array)$this->coltypes[$field]['attributes'];
}
/**
* Convert a record data set into LDAP field attributes
*/
@ -2043,7 +2023,6 @@ class rcube_ldap extends rcube_addressbook
return $default;
}
/**
* HTML-safe DN string encoding
*
@ -2070,5 +2049,4 @@ class rcube_ldap extends rcube_addressbook
$str = str_pad(strtr($str, '-_', '+/'), strlen($str) % 4, '=', STR_PAD_RIGHT);
return base64_decode($str);
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| Roundcube/rcube_ldap_generic.php |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2014, The Roundcube Dev Team |
@ -123,7 +123,6 @@ class rcube_message
$this->app->plugins->exec_hook('message_load', array('object' => $this));
}
/**
* Return a (decoded) message header
*
@ -140,7 +139,6 @@ class rcube_message
return $this->headers->get($name, !$raw);
}
/**
* Set is_safe var and session data
*
@ -151,7 +149,6 @@ class rcube_message
$_SESSION['safe_messages'][$this->folder.':'.$this->uid] = $this->is_safe = $safe;
}
/**
* Compose a valid URL for getting a message part
*
@ -167,7 +164,6 @@ class rcube_message
return false;
}
/**
* Get content of a specific part of this message
*
@ -199,7 +195,6 @@ class rcube_message
}
}
/**
* Get content of a specific part of this message
*
@ -283,7 +278,6 @@ class rcube_message
return $body;
}
/**
* Format text message part for display
*
@ -324,7 +318,6 @@ class rcube_message
return $body;
}
/**
* Determine if the message contains a HTML part. This must to be
* a real part not an attachment (or its part)
@ -370,7 +363,6 @@ class rcube_message
return false;
}
/**
* Determine if the message contains a text/plain part. This must to be
* a real part not an attachment (or its part)
@ -410,7 +402,6 @@ class rcube_message
return false;
}
/**
* Return the first HTML part of this message
*
@ -426,7 +417,6 @@ class rcube_message
}
}
/**
* Return the first text part of this message
*
@ -457,7 +447,6 @@ class rcube_message
return null;
}
/**
* Checks if part of the message is an attachment (or part of it)
*
@ -483,7 +472,6 @@ class rcube_message
return false;
}
/**
* Read the message structure returend by the IMAP server
* and build flat lists of content parts and attachments
@ -860,7 +848,6 @@ class rcube_message
}
}
/**
* Fill aflat array with references to all parts, indexed by part numbers
*
@ -876,7 +863,6 @@ class rcube_message
$this->get_mime_numbers($part->parts[$i]);
}
/**
* Decode a Microsoft Outlook TNEF part (winmail.dat)
*
@ -912,7 +898,6 @@ class rcube_message
return $parts;
}
/**
* Parse message body for UUencoded attachments bodies
*

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -56,11 +56,6 @@ class rcube_message_part
*/
public $mimetype = 'text/plain';
public $disposition = '';
public $filename = '';
public $encoding = '8bit';
public $charset = '';
/**
* Part size in bytes
*
@ -75,6 +70,10 @@ class rcube_message_part
*/
public $headers = array();
public $disposition = '';
public $filename = '';
public $encoding = '8bit';
public $charset = '';
public $d_parameters = array();
public $ctype_parameters = array();
@ -92,5 +91,4 @@ class rcube_message_part
}
}
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2014, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube PHP suite |
| Copyright (C) 2005-2014 The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2014, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2011, The Roundcube Dev Team |
@ -46,7 +46,6 @@ class rcube_result_index
$this->init($data);
}
/**
* Initializes object with SORT command response
*
@ -127,7 +126,6 @@ class rcube_result_index
$this->raw_data = $data;
}
/**
* Checks the result from IMAP command
*
@ -138,7 +136,6 @@ class rcube_result_index
return $this->raw_data === null ? true : false;
}
/**
* Checks if the result is empty
*
@ -149,7 +146,6 @@ class rcube_result_index
return empty($this->raw_data) ? true : false;
}
/**
* Returns number of elements in the result
*
@ -171,7 +167,6 @@ class rcube_result_index
return $this->meta['count'];
}
/**
* Returns number of elements in the result.
* Alias for count() for compatibility with rcube_result_thread
@ -183,7 +178,6 @@ class rcube_result_index
return $this->count();
}
/**
* Returns maximal message identifier in the result
*
@ -198,7 +192,6 @@ class rcube_result_index
return $this->meta['max'];
}
/**
* Returns minimal message identifier in the result
*
@ -213,13 +206,11 @@ class rcube_result_index
return $this->meta['min'];
}
/**
* Slices data set.
*
* @param $offset Offset (as for PHP's array_slice())
* @param $length Number of elements (as for PHP's array_slice())
*
*/
public function slice($offset, $length)
{
@ -231,7 +222,6 @@ class rcube_result_index
$this->raw_data = implode(self::SEPARATOR_ELEMENT, $data);
}
/**
* Filters data set. Removes elements not listed in $ids list.
*
@ -247,7 +237,6 @@ class rcube_result_index
$this->raw_data = implode(self::SEPARATOR_ELEMENT, $data);
}
/**
* Reverts order of elements in the result
*/
@ -267,7 +256,6 @@ class rcube_result_index
$this->meta['pos'] = array();
}
/**
* Check if the given message ID exists in the object
*
@ -307,7 +295,6 @@ class rcube_result_index
return false;
}
/**
* Return all messages in the result.
*
@ -322,7 +309,6 @@ class rcube_result_index
return explode(self::SEPARATOR_ELEMENT, $this->raw_data);
}
/**
* Return all messages in the result.
*
@ -337,7 +323,6 @@ class rcube_result_index
return rcube_imap_generic::compressMessageSet($this->get());
}
/**
* Return result element at specified index
*
@ -397,7 +382,6 @@ class rcube_result_index
return $data[$index];
}
/**
* Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ
* or internal data e.g. MAILBOX, ORDER
@ -419,7 +403,6 @@ class rcube_result_index
return $params;
}
/**
* Returns length of internal data representation
*

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2011, The Roundcube Dev Team |
@ -47,7 +47,6 @@ class rcube_result_multifolder
$this->meta = array('count' => 0);
}
/**
* Initializes object with SORT command response
*
@ -103,7 +102,6 @@ class rcube_result_multifolder
return false;
}
/**
* Checks if the result is empty
*
@ -114,7 +112,6 @@ class rcube_result_multifolder
return empty($this->sets) || $this->meta['count'] == 0;
}
/**
* Returns number of elements in the result
*
@ -125,7 +122,6 @@ class rcube_result_multifolder
return $this->meta['count'];
}
/**
* Returns number of elements in the result.
* Alias for count() for compatibility with rcube_result_thread
@ -137,7 +133,6 @@ class rcube_result_multifolder
return $this->count();
}
/**
* Reverts order of elements in the result
*/
@ -159,7 +154,6 @@ class rcube_result_multifolder
}
}
/**
* Check if the given message ID exists in the object
*
@ -178,7 +172,6 @@ class rcube_result_multifolder
return array_search($msgid, $this->index);
}
/**
* Filters data set. Removes elements listed in $ids list.
*
@ -232,7 +225,6 @@ class rcube_result_multifolder
return $this->index;
}
/**
* Return all messages in the result.
*
@ -243,7 +235,6 @@ class rcube_result_multifolder
return '';
}
/**
* Return result element at specified index
*
@ -260,7 +251,6 @@ class rcube_result_multifolder
}
}
/**
* Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ
* or internal data e.g. MAILBOX, ORDER
@ -333,5 +323,4 @@ class rcube_result_multifolder
}
}
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2006-2013, The Roundcube Dev Team |
@ -115,5 +115,4 @@ class rcube_result_set implements Iterator, ArrayAccess
{
return isset($this->records[$this->current]);
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2011, The Roundcube Dev Team |
@ -47,7 +47,6 @@ class rcube_result_thread
$this->init($data);
}
/**
* Initializes object with IMAP command response
*
@ -83,7 +82,6 @@ class rcube_result_thread
$this->raw_data = $this->parse_thread($data);
}
/**
* Checks the result from IMAP command
*
@ -94,7 +92,6 @@ class rcube_result_thread
return $this->raw_data === null ? true : false;
}
/**
* Checks if the result is empty
*
@ -105,7 +102,6 @@ class rcube_result_thread
return empty($this->raw_data) ? true : false;
}
/**
* Returns number of elements (threads) in the result
*
@ -129,7 +125,6 @@ class rcube_result_thread
return $this->meta['count'];
}
/**
* Returns number of all messages in the result
*
@ -155,7 +150,6 @@ class rcube_result_thread
return $this->meta['messages'];
}
/**
* Returns maximum message identifier in the result
*
@ -169,7 +163,6 @@ class rcube_result_thread
return $this->meta['max'];
}
/**
* Returns minimum message identifier in the result
*
@ -183,7 +176,6 @@ class rcube_result_thread
return $this->meta['min'];
}
/**
* Slices data set.
*
@ -200,7 +192,6 @@ class rcube_result_thread
$this->raw_data = implode(self::SEPARATOR_ELEMENT, $data);
}
/**
* Filters data set. Removes threads not listed in $roots list.
*
@ -240,7 +231,6 @@ class rcube_result_thread
$this->raw_data = ltrim($result, self::SEPARATOR_ELEMENT);
}
/**
* Reverts order of elements in the result
*/
@ -270,7 +260,6 @@ class rcube_result_thread
$this->raw_data = rtrim($result, self::SEPARATOR_ELEMENT);
}
/**
* Check if the given message ID exists in the object
*
@ -314,7 +303,6 @@ class rcube_result_thread
return false;
}
/**
* Return IDs of all messages in the result. Threaded data will be flattened.
*
@ -333,7 +321,6 @@ class rcube_result_thread
return preg_split($regexp, $this->raw_data);
}
/**
* Return all messages in the result.
*
@ -348,7 +335,6 @@ class rcube_result_thread
return rcube_imap_generic::compressMessageSet($this->get());
}
/**
* Return result element at specified index (all messages, not roots)
*
@ -418,11 +404,10 @@ class rcube_result_thread
return $data[$index];
}
/**
* Returns response parameters e.g. MAILBOX, ORDER
*
* @param string $param Parameter name
* @param string $param Parameter name
*
* @return array|string Response parameters or parameter value
*/
@ -439,7 +424,6 @@ class rcube_result_thread
return $params;
}
/**
* THREAD=REFS sorting implementation (based on provided index)
*
@ -509,7 +493,6 @@ class rcube_result_thread
$this->raw_data = implode(self::SEPARATOR_ELEMENT, $result);
}
/**
* Returns data as tree
*
@ -534,7 +517,6 @@ class rcube_result_thread
return $result;
}
/**
* Returns thread depth and children data
*
@ -551,7 +533,6 @@ class rcube_result_thread
return array($depth, $children);
}
/**
* Creates 'depth' and 'children' arrays from stored thread 'tree' data.
*/
@ -567,7 +548,6 @@ class rcube_result_thread
}
}
/**
* Converts part of the raw thread into an array
*/
@ -590,7 +570,6 @@ class rcube_result_thread
return $result;
}
/**
* IMAP THREAD response parser
*/

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2014, The Roundcube Dev Team |
@ -15,7 +15,7 @@
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
| Author: Aleksander Machniak <alec@alec.pl> |
| Author: Cor Bosman <cor@roundcu.be> |
| Author: Cor Bosman <cor@roundcu.be> |
+-----------------------------------------------------------------------+
*/
@ -29,22 +29,22 @@
*/
abstract class rcube_session
{
protected $config;
protected $key;
protected $ip;
protected $changed;
protected $start;
protected $time_diff = 0;
protected $reloaded = false;
protected $appends = array();
protected $unsets = array();
protected $gc_handlers = array();
protected $cookiename = 'roundcube_sessauth';
protected $vars;
protected $now;
protected $secret = '';
protected $ip_check = false;
protected $logging = false;
protected $config;
protected $time_diff = 0;
protected $reloaded = false;
protected $appends = array();
protected $unsets = array();
protected $gc_handlers = array();
protected $cookiename = 'roundcube_sessauth';
protected $secret = '';
protected $ip_check = false;
protected $logging = false;
/**
* Blocks session data from being written to database.
@ -116,7 +116,6 @@ abstract class rcube_session
);
}
/**
* Wrapper for session_start()
*/
@ -142,12 +141,12 @@ abstract class rcube_session
abstract function write($key, $vars);
abstract function update($key, $newvars, $oldvars);
/**
* session write handler. This calls the implementation methods for write/update after some initial checks.
*
* @param $key
* @param $vars
*
* @return bool
*/
public function sess_write($key, $vars)
@ -169,7 +168,6 @@ abstract class rcube_session
}
}
/**
* Wrapper for session_write_close()
*/
@ -242,7 +240,6 @@ abstract class rcube_session
$this->gc_handlers[] = $func;
}
/**
* Garbage collector handler to run on script shutdown
*/
@ -255,7 +252,6 @@ abstract class rcube_session
}
}
/**
* Generate and set new session id
*
@ -294,7 +290,6 @@ abstract class rcube_session
return $cache;
}
/**
* Append the given value to the certain node in the session data array
*
@ -328,7 +323,6 @@ abstract class rcube_session
unset($this->unsets[$path]);
}
/**
* Unset a session variable
*
@ -356,19 +350,17 @@ abstract class rcube_session
return true;
}
/**
* Kill this session
*/
public function kill()
{
$this->vars = null;
$this->ip = rcube_utils::remote_addr(); // update IP (might have changed)
$this->ip = rcube_utils::remote_addr(); // update IP (might have changed)
$this->destroy(session_id());
rcube_utils::setcookie($this->cookiename, '-del-', time() - 60);
}
/**
* Re-read session data from storage backend
*/
@ -444,7 +436,6 @@ abstract class rcube_session
return $data;
}
/**
* Unserialize session data
* http://www.php.net/manual/en/function.session-decode.php#56106
@ -543,7 +534,6 @@ abstract class rcube_session
return unserialize( 'a:' . $items . ':{' . $serialized . '}' );
}
/**
* Setter for session lifetime
*/
@ -556,7 +546,6 @@ abstract class rcube_session
$this->now = $now - ($now % ($this->lifetime / 2));
}
/**
* Getter for remote IP saved with this session
*/
@ -565,7 +554,6 @@ abstract class rcube_session
return $this->ip;
}
/**
* Setter for cookie encryption secret
*/
@ -574,7 +562,6 @@ abstract class rcube_session
$this->secret = $secret;
}
/**
* Enable/disable IP check
*/
@ -583,7 +570,6 @@ abstract class rcube_session
$this->ip_check = $check;
}
/**
* Setter for the cookie name used for session cookie
*/
@ -594,7 +580,6 @@ abstract class rcube_session
}
}
/**
* Check session authentication cookie
*
@ -632,7 +617,6 @@ abstract class rcube_session
return $result;
}
/**
* Set session authentication cookie
*/
@ -643,7 +627,6 @@ abstract class rcube_session
$_COOKIE[$this->cookiename] = $this->cookie;
}
/**
* Create session cookie from session data
*

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2014, The Roundcube Dev Team |
@ -71,7 +71,6 @@ class rcube_session_db extends rcube_session
return true;
}
/**
* Handler for session_destroy()
*
@ -109,7 +108,6 @@ class rcube_session_db extends rcube_session
return !empty($this->vars) ? (string) $this->vars : '';
}
return null;
}
/**
@ -121,17 +119,16 @@ class rcube_session_db extends rcube_session
*/
public function write($key, $vars)
{
$now = $this->db->now();
$now = $this->db->now();
$this->db->query("INSERT INTO {$this->table_name}"
. " (`sess_id`, `vars`, `ip`, `created`, `changed`)"
. " VALUES (?, ?, ?, $now, $now)",
$key, base64_encode($vars), (string)$this->ip);
. " (`sess_id`, `vars`, `ip`, `created`, `changed`)"
. " VALUES (?, ?, ?, $now, $now)",
$key, base64_encode($vars), (string)$this->ip);
return true;
}
/**
* update session data
*
@ -150,12 +147,12 @@ class rcube_session_db extends rcube_session
// else update expire timestamp only when certain conditions are met
if ($newvars !== $oldvars) {
$this->db->query("UPDATE {$this->table_name} "
. "SET `changed` = $now, `vars` = ? WHERE `sess_id` = ?",
base64_encode($newvars), $key);
. "SET `changed` = $now, `vars` = ? WHERE `sess_id` = ?",
base64_encode($newvars), $key);
}
else if ($ts - $this->changed + $this->time_diff > $this->lifetime / 2) {
$this->db->query("UPDATE {$this->table_name} SET `changed` = $now"
. " WHERE `sess_id` = ?", $key);
. " WHERE `sess_id` = ?", $key);
}
return true;
@ -168,8 +165,10 @@ class rcube_session_db extends rcube_session
{
// just clean all old sessions when this GC is called
$this->db->query("DELETE FROM " . $this->db->table_name('session')
. " WHERE changed < " . $this->db->now(-$this->gc_enabled));
$this->log("Session GC (DB): remove records < " . date('Y-m-d H:i:s', time() - $this->gc_enabled) . '; rows = ' . intval($this->db->affected_rows()));
}
. " WHERE changed < " . $this->db->now(-$this->gc_enabled));
}
$this->log("Session GC (DB): remove records < "
. date('Y-m-d H:i:s', time() - $this->gc_enabled)
. '; rows = ' . intval($this->db->affected_rows()));
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2014, The Roundcube Dev Team |
@ -93,7 +93,6 @@ class rcube_session_memcache extends rcube_session
return true;
}
/**
* Read session data from memcache
*

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2014, The Roundcube Dev Team |
@ -73,5 +73,4 @@ class rcube_session_php extends rcube_session {
$this->changed = $_SESSION['__MTIME'];
}
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2014, The Roundcube Dev Team |
@ -10,7 +10,7 @@
| See the README file for a full license statement. |
| |
| PURPOSE: |
| Provide redis supported session management |
| Provide redis supported session management |
+-----------------------------------------------------------------------+
| Author: Cor Bosman <cor@roundcu.be> |
+-----------------------------------------------------------------------+
@ -152,7 +152,6 @@ class rcube_session_redis extends rcube_session {
return true;
}
/**
* read data from redis store
*
@ -170,11 +169,8 @@ class rcube_session_redis extends rcube_session {
return !empty($this->vars) ? (string) $this->vars : '';
}
return null;
}
/**
* write data to redis store
*
@ -188,13 +184,13 @@ class rcube_session_redis extends rcube_session {
$ts = microtime(true);
if ($newvars !== $oldvars || $ts - $this->changed > $this->lifetime / 3) {
$this->redis->setex($key, $this->lifetime + 60, serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars)));
$data = serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars));
$this->redis->setex($key, $this->lifetime + 60, $data);
}
return true;
}
/**
* write data to redis store
*
@ -204,8 +200,8 @@ class rcube_session_redis extends rcube_session {
*/
public function write($key, $vars)
{
return $this->redis->setex($key, $this->lifetime + 60, serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $vars)));
}
$data = serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $vars));
}
return $this->redis->setex($key, $this->lifetime + 60, $data);
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -26,7 +26,7 @@
*/
class rcube_smtp
{
private $conn = null;
private $conn;
private $response;
private $error;
private $anonymize_log = 0;
@ -331,7 +331,6 @@ class rcube_smtp
}
}
/**
* This is our own debug handler for the SMTP connection
*/

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| |
@ -199,6 +199,4 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine
return $result;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| |
@ -177,6 +177,4 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine
return $result;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| |
@ -86,6 +86,4 @@ abstract class rcube_spellcheck_engine
{
return $this->error;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| |
@ -175,6 +175,4 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine
return $result;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| |
@ -184,6 +184,4 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine
return $result;
}
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2011-2013, Kolab Systems AG |
@ -137,7 +137,6 @@ class rcube_spellchecker
return $this->found() == 0;
}
/**
* Number of mispellings found (after check)
*
@ -148,7 +147,6 @@ class rcube_spellchecker
return count($this->matches);
}
/**
* Returns suggestions for the specified word
*
@ -165,7 +163,6 @@ class rcube_spellchecker
return array();
}
/**
* Returns misspelled words
*
@ -187,7 +184,6 @@ class rcube_spellchecker
return array();
}
/**
* Returns checking result in XML (Googiespell) format
*
@ -209,7 +205,6 @@ class rcube_spellchecker
return $out;
}
/**
* Returns checking result (misspelled words with suggestions)
*
@ -243,7 +238,6 @@ class rcube_spellchecker
return $result;
}
/**
* Returns error message
*
@ -254,14 +248,12 @@ class rcube_spellchecker
return $this->error ? $this->error : ($this->backend ? $this->backend->error() : false);
}
private function html2text($text)
{
$h2t = new rcube_html2text($text, false, true, 0);
return $h2t->get_text();
}
/**
* Check if the specified word is an exception accoring to
* spellcheck options.
@ -300,7 +292,6 @@ class rcube_spellchecker
return false;
}
/**
* Add a word to dictionary
*
@ -324,7 +315,6 @@ class rcube_spellchecker
}
}
/**
* Remove a word from dictionary
*
@ -340,7 +330,6 @@ class rcube_spellchecker
}
}
/**
* Update dictionary row in DB
*/
@ -383,7 +372,6 @@ class rcube_spellchecker
}
}
/**
* Get dictionary from DB
*/

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
@ -93,13 +93,11 @@ abstract class rcube_storage
*/
abstract function connect($host, $user, $pass, $port = 143, $use_ssl = null);
/**
* Close connection. Usually done on script shutdown
*/
abstract function close();
/**
* Checks connection state.
*
@ -107,7 +105,6 @@ abstract class rcube_storage
*/
abstract function is_connected();
/**
* Check connection state, connect if not connected.
*
@ -115,7 +112,6 @@ abstract class rcube_storage
*/
abstract function check_connection();
/**
* Returns code of last error
*
@ -123,7 +119,6 @@ abstract class rcube_storage
*/
abstract function get_error_code();
/**
* Returns message of last error
*
@ -131,7 +126,6 @@ abstract class rcube_storage
*/
abstract function get_error_str();
/**
* Returns code of last command response
*
@ -139,7 +133,6 @@ abstract class rcube_storage
*/
abstract function get_response_code();
/**
* Set connection and class options
*
@ -150,7 +143,6 @@ abstract class rcube_storage
$this->options = array_merge($this->options, (array)$opt);
}
/**
* Get connection/class option
*
@ -163,7 +155,6 @@ abstract class rcube_storage
return $this->options[$name];
}
/**
* Activate/deactivate debug mode.
*
@ -171,7 +162,6 @@ abstract class rcube_storage
*/
abstract function set_debug($dbg = true);
/**
* Set default message charset.
*
@ -184,7 +174,6 @@ abstract class rcube_storage
$this->default_charset = $cs;
}
/**
* Set internal folder reference.
* All operations will be perfomed on this folder.
@ -200,7 +189,6 @@ abstract class rcube_storage
$this->folder = $folder;
}
/**
* Returns the currently used folder name
*
@ -211,7 +199,6 @@ abstract class rcube_storage
return $this->folder;
}
/**
* Set internal list page number.
*
@ -222,7 +209,6 @@ abstract class rcube_storage
$this->list_page = (int) $page;
}
/**
* Gets internal list page number.
*
@ -233,7 +219,6 @@ abstract class rcube_storage
return $this->list_page;
}
/**
* Set internal page size
*
@ -244,7 +229,6 @@ abstract class rcube_storage
$this->page_size = (int) $size;
}
/**
* Get internal page size
*
@ -255,7 +239,6 @@ abstract class rcube_storage
return $this->page_size;
}
/**
* Save a search result for future message listing methods.
*
@ -263,7 +246,6 @@ abstract class rcube_storage
*/
abstract function set_search_set($set);
/**
* Return the saved search set.
*
@ -271,7 +253,6 @@ abstract class rcube_storage
*/
abstract function get_search_set();
/**
* Returns the storage server's (IMAP) capability
*
@ -281,7 +262,6 @@ abstract class rcube_storage
*/
abstract function get_capability($cap);
/**
* Sets threading flag to the best supported THREAD algorithm.
* Enable/Disable threaded mode.
@ -304,7 +284,6 @@ abstract class rcube_storage
return $this->threading;
}
/**
* Get current threading flag.
*
@ -315,7 +294,6 @@ abstract class rcube_storage
return $this->threading;
}
/**
* Checks the PERMANENTFLAGS capability of the current folder
* and returns true if the given flag is supported by the server.
@ -326,7 +304,6 @@ abstract class rcube_storage
*/
abstract function check_permflag($flag);
/**
* Returns the delimiter that is used by the server
* for folder hierarchy separation.
@ -335,7 +312,6 @@ abstract class rcube_storage
*/
abstract function get_hierarchy_delimiter();
/**
* Get namespace
*
@ -345,7 +321,6 @@ abstract class rcube_storage
*/
abstract function get_namespace($name = null);
/**
* Get messages count for a specific folder.
*
@ -359,7 +334,6 @@ abstract class rcube_storage
*/
abstract function count($folder = null, $mode = 'ALL', $force = false, $status = true);
/**
* Public method for listing message flags
*
@ -371,7 +345,6 @@ abstract class rcube_storage
*/
abstract function list_flags($folder, $uids, $mod_seq = null);
/**
* Public method for listing headers.
*
@ -385,7 +358,6 @@ abstract class rcube_storage
*/
abstract function list_messages($folder = null, $page = null, $sort_field = null, $sort_order = null, $slice = 0);
/**
* Return sorted list of message UIDs
*
@ -397,7 +369,6 @@ abstract class rcube_storage
*/
abstract function index($folder = null, $sort_field = null, $sort_order = null);
/**
* Invoke search request to the server.
*
@ -410,7 +381,6 @@ abstract class rcube_storage
*/
abstract function search($folder = null, $str = 'ALL', $charset = null, $sort_field = null);
/**
* Direct (real and simple) search request (without result sorting and caching).
*
@ -421,7 +391,6 @@ abstract class rcube_storage
*/
abstract function search_once($folder = null, $str = 'ALL');
/**
* Refresh saved search set
*
@ -445,7 +414,6 @@ abstract class rcube_storage
*/
abstract function get_message($uid, $folder = null);
/**
* Return message headers object of a specific message
*
@ -457,7 +425,6 @@ abstract class rcube_storage
*/
abstract function get_message_headers($uid, $folder = null, $force = false);
/**
* Fetch message body of a specific message from the server
*
@ -472,7 +439,6 @@ abstract class rcube_storage
*/
abstract function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null, $skip_charset_conv = false);
/**
* Fetch message body of a specific message from the server
*
@ -488,7 +454,6 @@ abstract class rcube_storage
$headers->charset ? $headers->charset : $this->default_charset);
}
/**
* Returns the whole message source as string (or saves to a file)
*
@ -500,7 +465,6 @@ abstract class rcube_storage
*/
abstract function get_raw_body($uid, $fp = null, $part = null);
/**
* Returns the message headers as string
*
@ -511,7 +475,6 @@ abstract class rcube_storage
*/
abstract function get_raw_headers($uid, $part = null);
/**
* Sends the whole message source to stdout
*
@ -520,7 +483,6 @@ abstract class rcube_storage
*/
abstract function print_raw_body($uid, $formatted = true);
/**
* Set message flag to one or several messages
*
@ -533,7 +495,6 @@ abstract class rcube_storage
*/
abstract function set_flag($uids, $flag, $folder = null, $skip_cache = false);
/**
* Remove message flag for one or several messages
*
@ -549,7 +510,6 @@ abstract class rcube_storage
return $this->set_flag($uids, 'UN'.$flag, $folder);
}
/**
* Append a mail message (source) to a specific folder.
*
@ -565,7 +525,6 @@ abstract class rcube_storage
*/
abstract function save_message($folder, &$message, $headers = '', $is_file = false, $flags = array(), $date = null);
/**
* Move message(s) from one folder to another.
*
@ -577,7 +536,6 @@ abstract class rcube_storage
*/
abstract function move_message($uids, $to, $from = null);
/**
* Copy message(s) from one mailbox to another.
*
@ -589,7 +547,6 @@ abstract class rcube_storage
*/
abstract function copy_message($uids, $to, $from = null);
/**
* Mark message(s) as deleted and expunge.
*
@ -600,7 +557,6 @@ abstract class rcube_storage
*/
abstract function delete_message($uids, $folder = null);
/**
* Expunge message(s) and clear the cache.
*
@ -612,7 +568,6 @@ abstract class rcube_storage
*/
abstract function expunge_message($uids, $folder = null, $clear_cache = true);
/**
* Parse message UIDs input
*
@ -666,7 +621,6 @@ abstract class rcube_storage
*/
abstract function list_folders_subscribed($root = '', $name = '*', $filter = null, $rights = null, $skip_sort = false);
/**
* Get a list of all folders available on the server.
*
@ -680,7 +634,6 @@ abstract class rcube_storage
*/
abstract function list_folders($root = '', $name = '*', $filter = null, $rights = null, $skip_sort = false);
/**
* Subscribe to a specific folder(s)
*
@ -690,7 +643,6 @@ abstract class rcube_storage
*/
abstract function subscribe($folders);
/**
* Unsubscribe folder(s)
*
@ -700,7 +652,6 @@ abstract class rcube_storage
*/
abstract function unsubscribe($folders);
/**
* Create a new folder on the server.
*
@ -711,7 +662,6 @@ abstract class rcube_storage
*/
abstract function create_folder($folder, $subscribe = false);
/**
* Set a new name to an existing folder
*
@ -722,7 +672,6 @@ abstract class rcube_storage
*/
abstract function rename_folder($folder, $new_name);
/**
* Remove a folder from the server.
*
@ -732,7 +681,6 @@ abstract class rcube_storage
*/
abstract function delete_folder($folder);
/**
* Send expunge command and clear the cache.
*
@ -746,7 +694,6 @@ abstract class rcube_storage
return $this->expunge_message('*', $folder, $clear_cache);
}
/**
* Remove all messages in a folder..
*
@ -759,7 +706,6 @@ abstract class rcube_storage
return $this->delete_message('*', $folder);
}
/**
* Checks if folder exists and is subscribed
*
@ -770,7 +716,6 @@ abstract class rcube_storage
*/
abstract function folder_exists($folder, $subscription = false);
/**
* Get folder size (size of all messages in a folder)
*
@ -780,7 +725,6 @@ abstract class rcube_storage
*/
abstract function folder_size($folder);
/**
* Returns the namespace where the folder is in
*
@ -790,7 +734,6 @@ abstract class rcube_storage
*/
abstract function folder_namespace($folder);
/**
* Gets folder attributes (from LIST response, e.g. \Noselect, \Noinferiors).
*
@ -801,7 +744,6 @@ abstract class rcube_storage
*/
abstract function folder_attributes($folder, $force = false);
/**
* Gets connection (and current folder) data: UIDVALIDITY, EXISTS, RECENT,
* PERMANENTFLAGS, UIDNEXT, UNSEEN
@ -812,7 +754,6 @@ abstract class rcube_storage
*/
abstract function folder_data($folder);
/**
* Returns extended information about the folder.
*
@ -822,7 +763,6 @@ abstract class rcube_storage
*/
abstract function folder_info($folder);
/**
* Returns current status of a folder (compared to the last time use)
*
@ -833,7 +773,6 @@ abstract class rcube_storage
*/
abstract function folder_status($folder = null, &$diff = array());
/**
* Synchronizes messages cache.
*
@ -841,7 +780,6 @@ abstract class rcube_storage
*/
abstract function folder_sync($folder);
/**
* Modify folder name according to namespace.
* For output it removes prefix of the personal namespace if it's possible.
@ -855,7 +793,6 @@ abstract class rcube_storage
*/
abstract function mod_folder($folder, $mode = 'out');
/**
* Create all folders specified as default
*/
@ -876,7 +813,6 @@ abstract class rcube_storage
}
}
/**
* Check if specified folder is a special folder
*/
@ -885,7 +821,6 @@ abstract class rcube_storage
return $name == 'INBOX' || in_array($name, $this->get_special_folders());
}
/**
* Return configured special folders
*/
@ -906,7 +841,6 @@ abstract class rcube_storage
return $this->icache['special-folders'];
}
/**
* Set special folder associations stored in backend
*/
@ -916,7 +850,6 @@ abstract class rcube_storage
unset($this->icache['special-folders']);
}
/**
* Get mailbox quota information.
*
@ -942,7 +875,6 @@ abstract class rcube_storage
*/
abstract function set_acl($folder, $user, $acl);
/**
* Removes any <identifier,rights> pair for the
* specified user from the ACL for the specified
@ -955,7 +887,6 @@ abstract class rcube_storage
*/
abstract function delete_acl($folder, $user);
/**
* Returns the access control list for a folder (GETACL).
*
@ -965,7 +896,6 @@ abstract class rcube_storage
*/
abstract function get_acl($folder);
/**
* Returns information about what rights can be granted to the
* user (identifier) in the ACL for the folder (LISTRIGHTS).
@ -977,7 +907,6 @@ abstract class rcube_storage
*/
abstract function list_rights($folder, $user);
/**
* Returns the set of rights that the current user has to a folder (MYRIGHTS).
*
@ -987,7 +916,6 @@ abstract class rcube_storage
*/
abstract function my_rights($folder);
/**
* Sets metadata/annotations (SETMETADATA/SETANNOTATION)
*
@ -998,7 +926,6 @@ abstract class rcube_storage
*/
abstract function set_metadata($folder, $entries);
/**
* Unsets metadata/annotations (SETMETADATA/SETANNOTATION)
*
@ -1009,7 +936,6 @@ abstract class rcube_storage
*/
abstract function delete_metadata($folder, $entries);
/**
* Returns folder metadata/annotations (GETMETADATA/GETANNOTATION).
*
@ -1021,7 +947,6 @@ abstract class rcube_storage
*/
abstract function get_metadata($folder, $entries, $options = array());
/* -----------------------------------------
* Cache related functions
* ----------------------------------------*/
@ -1035,7 +960,6 @@ abstract class rcube_storage
*/
abstract function clear_cache($key = null, $prefix_mode = false);
/**
* Returns cached value
*
@ -1045,10 +969,8 @@ abstract class rcube_storage
*/
abstract function get_cache($key);
/**
* Delete outdated cache entries
*/
abstract function cache_gc();
} // end class rcube_storage
}

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2009-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2014, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2014, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2012, The Roundcube Dev Team |
@ -134,7 +134,6 @@ class rcube_utils
return false;
}
/**
* Validates IPv4 or IPv6 address
*
@ -179,7 +178,6 @@ class rcube_utils
return @inet_pton($ip) !== false;
}
/**
* Check whether the HTTP referer matches the current request
*
@ -192,7 +190,6 @@ class rcube_utils
return $referer['host'] == self::request_header('Host') && $referer['path'] == $uri['path'];
}
/**
* Replacing specials characters to a specific encoding type
*
@ -283,7 +280,6 @@ class rcube_utils
return $str;
}
/**
* Read input value and convert it for internal use
* Performs stripslashes() and charset conversion if necessary
@ -324,7 +320,6 @@ class rcube_utils
return self::parse_input_value($value, $allow_html, $charset);
}
/**
* Parse/validate input value. See self::get_input_value()
* Performs stripslashes() and charset conversion if necessary
@ -375,7 +370,6 @@ class rcube_utils
return $value;
}
/**
* Convert array of request parameters (prefixed with _)
* to a regular array with non-prefixed keys.
@ -401,7 +395,6 @@ class rcube_utils
return $out;
}
/**
* Convert the given string into a valid HTML identifier
* Same functionality as done in app.js with rcube_webmail.html_identifier()
@ -416,7 +409,6 @@ class rcube_utils
}
}
/**
* Replace all css definitions with #container [def]
* and remove css-inlined scripting
@ -493,7 +485,6 @@ class rcube_utils
return $source;
}
/**
* Generate CSS classes from mimetype and filename extension
*
@ -524,7 +515,6 @@ class rcube_utils
return join(" ", $classes);
}
/**
* Decode escaped entities used by known XSS exploits.
* See http://downloads.securityfocus.com/vulnerabilities/exploits/26800.eml for examples
@ -543,7 +533,6 @@ class rcube_utils
return $out;
}
/**
* preg_replace_callback callback for xss_entity_decode
*
@ -556,7 +545,6 @@ class rcube_utils
return chr(hexdec($matches[1]));
}
/**
* Check if we can process not exceeding memory_limit
*
@ -572,7 +560,6 @@ class rcube_utils
return $mem_limit > 0 && $memory + $need > $mem_limit ? false : true;
}
/**
* Check if working in SSL mode
*
@ -601,7 +588,6 @@ class rcube_utils
return false;
}
/**
* Replaces hostname variables.
*
@ -639,7 +625,6 @@ class rcube_utils
return str_replace(array('%n', '%t', '%d', '%h', '%z', '%s'), array($n, $t, $d, $h, $z, $s[2]), $name);
}
/**
* Returns remote IP address and forwarded addresses if found
*
@ -665,7 +650,6 @@ class rcube_utils
return $address;
}
/**
* Returns the real remote IP address
*
@ -747,7 +731,6 @@ class rcube_utils
return $result;
}
/**
* Improved equivalent to strtotime()
*
@ -878,7 +861,6 @@ class rcube_utils
return self::idn_convert($str, true);
}
/*
* Idn_to_ascii wrapper.
* Intl/Idn modules version of this function doesn't work with e-mail address
@ -888,8 +870,7 @@ class rcube_utils
return self::idn_convert($str, false);
}
public static function idn_convert($input, $is_utf=false)
public static function idn_convert($input, $is_utf = false)
{
if ($at = strpos($input, '@')) {
$user = substr($input, 0, $at);

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2008-2012, The Roundcube Dev Team |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/copy.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/delete.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/edit.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/export.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/func.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/groups.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/import.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/list.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/mailto.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/move.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/photo.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/print.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/save.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/search.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/show.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/undo.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/addressbook/upload_photo.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/addcontact.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/attachments.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/autocomplete.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/check_recent.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/compose.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/copy.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/folders.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/func.inc |
| |

@ -1,6 +1,6 @@
<?php
/*
/**
+-----------------------------------------------------------------------+
| program/steps/mail/get.inc |
| |

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save