| | |
| | | |
| | | // we can use the database for storing session data |
| | | // session queries do not work with MDB2 |
| | | if ($CONFIG['db_backend']!='mdb2' && is_object($DB) /* && $DB->db_provider!='sqlite' */) |
| | | if ($CONFIG['db_backend']!='mdb2' && is_object($DB)) |
| | | include_once('include/session.inc'); |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | // remove all expired message cache records |
| | | function rcmail_message_cache_gc() |
| | | { |
| | | global $DB, $CONFIG; |
| | | |
| | | // no cache lifetime configured |
| | | if (empty($CONFIG['message_cache_lifetime'])) |
| | | return; |
| | | |
| | | // get target timestamp |
| | | $ts = get_offset_time($CONFIG['message_cache_lifetime'], -1); |
| | | |
| | | $DB->query("DELETE FROM ".get_table_name('messages')." |
| | | WHERE created < ".$DB->fromunixtime($ts)); |
| | | } |
| | | |
| | | |
| | | // convert a string from one charset to another |
| | | // this function is not complete and not tested well |
| | |
| | | if (function_exists('iconv') && $from!='UTF-7' && $to!='UTF-7') { |
| | | return iconv($from, $to, $str); |
| | | } |
| | | |
| | | |
| | | $conv = new utf8(); |
| | | |
| | | // convert string to UTF-8 |
| | | if ($from=='UTF-7') |
| | | $str = rcube_charset_convert(UTF7DecodeString($str), 'ISO-8859-1'); |
| | |
| | | $str = utf8_encode($str); |
| | | else if ($from!='UTF-8') |
| | | { |
| | | $conv = new utf8($from); |
| | | $conv->loadCharset($from); |
| | | $str = $conv->strToUtf8($str); |
| | | } |
| | | |
| | |
| | | return utf8_decode($str); |
| | | else if ($to!='UTF-8') |
| | | { |
| | | $conv = new utf8($to); |
| | | $conv->loadCharset($to); |
| | | return $conv->utf8ToStr($str); |
| | | } |
| | | |
| | |
| | | 'message' => 'rcmail_message_container', |
| | | 'messages' => 'rcmail_message_list', |
| | | 'messagecountdisplay' => 'rcmail_messagecount_display', |
| | | 'quotadisplay' => 'rcmail_quota_display', |
| | | 'messageheaders' => 'rcmail_message_headers', |
| | | 'messagebody' => 'rcmail_message_body', |
| | | 'messageattachments' => 'rcmail_message_attachments', |
| | |
| | | } |
| | | |
| | | |
| | | /****** debugging function ********/ |
| | | |
| | | function rcube_timer() |
| | | { |
| | | list($usec, $sec) = explode(" ", microtime()); |