Avoid unused variables (also fixed some bugs) found in static code analysis
This commit is contained in:
parent
5738a7a7ec
commit
ac4f6e7562
23 changed files with 36 additions and 53 deletions
|
@ -61,7 +61,6 @@ class calendar extends rcube_plugin
|
||||||
private $ical;
|
private $ical;
|
||||||
private $itip;
|
private $itip;
|
||||||
private $driver;
|
private $driver;
|
||||||
private $ics_parts = array();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2469,7 +2468,7 @@ class calendar extends rcube_plugin
|
||||||
public function mail_messages_list($p)
|
public function mail_messages_list($p)
|
||||||
{
|
{
|
||||||
if (in_array('attachment', (array)$p['cols']) && !empty($p['messages'])) {
|
if (in_array('attachment', (array)$p['cols']) && !empty($p['messages'])) {
|
||||||
foreach ($p['messages'] as $i => $header) {
|
foreach ($p['messages'] as $header) {
|
||||||
$part = new StdClass;
|
$part = new StdClass;
|
||||||
$part->mimetype = $header->ctype;
|
$part->mimetype = $header->ctype;
|
||||||
if (libcalendaring::part_is_vcalendar($part)) {
|
if (libcalendaring::part_is_vcalendar($part)) {
|
||||||
|
@ -2873,7 +2872,7 @@ class calendar extends rcube_plugin
|
||||||
$part = $imap->get_message_part($uid, $mime_id);
|
$part = $imap->get_message_part($uid, $mime_id);
|
||||||
if ($part->ctype_parameters['charset'])
|
if ($part->ctype_parameters['charset'])
|
||||||
$charset = $part->ctype_parameters['charset'];
|
$charset = $part->ctype_parameters['charset'];
|
||||||
$headers = $imap->get_message_headers($uid);
|
// $headers = $imap->get_message_headers($uid);
|
||||||
|
|
||||||
if ($part) {
|
if ($part) {
|
||||||
$events = $this->get_ical()->import($part, $charset);
|
$events = $this->get_ical()->import($part, $charset);
|
||||||
|
|
|
@ -1186,7 +1186,7 @@ class database_driver extends calendar_driver
|
||||||
" WHERE user_id=?",
|
" WHERE user_id=?",
|
||||||
$user->ID);
|
$user->ID);
|
||||||
|
|
||||||
while ($row = $db->fetch_assoc($calendars)) {
|
while ($row = $db->fetch_assoc($events)) {
|
||||||
$event_ids[] = $row['event_id'];
|
$event_ids[] = $row['event_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,6 @@ class kolab_calendar extends kolab_storage_folder_api
|
||||||
*/
|
*/
|
||||||
public function get_caldav_url()
|
public function get_caldav_url()
|
||||||
{
|
{
|
||||||
$url = null;
|
|
||||||
if ($template = $this->cal->rc->config->get('calendar_caldav_url', null)) {
|
if ($template = $this->cal->rc->config->get('calendar_caldav_url', null)) {
|
||||||
return strtr($template, array(
|
return strtr($template, array(
|
||||||
'%h' => $_SERVER['HTTP_HOST'],
|
'%h' => $_SERVER['HTTP_HOST'],
|
||||||
|
|
|
@ -225,7 +225,7 @@ class kolab_user_calendar extends kolab_calendar
|
||||||
}
|
}
|
||||||
|
|
||||||
$events = array();
|
$events = array();
|
||||||
foreach ($this->events as $id => $event) {
|
foreach ($this->events as $event) {
|
||||||
// list events in requested time window
|
// list events in requested time window
|
||||||
if ($event['start'] <= $end_dt && $event['end'] >= $start_dt &&
|
if ($event['start'] <= $end_dt && $event['end'] >= $start_dt &&
|
||||||
(!$limit_changed || !$event['changed'] || $event['changed'] >= $limit_changed)) {
|
(!$limit_changed || !$event['changed'] || $event['changed'] >= $limit_changed)) {
|
||||||
|
@ -310,8 +310,6 @@ class kolab_user_calendar extends kolab_calendar
|
||||||
$ical = $this->cal->get_ical();
|
$ical = $this->cal->get_ical();
|
||||||
$ical->import($fbdata);
|
$ical->import($fbdata);
|
||||||
if ($fb = $ical->freebusy) {
|
if ($fb = $ical->freebusy) {
|
||||||
$result = array();
|
|
||||||
|
|
||||||
// consider 'changed >= X' queries
|
// consider 'changed >= X' queries
|
||||||
if ($limit_changed && $fb['created'] && $fb['created'] < $limit_changed) {
|
if ($limit_changed && $fb['created'] && $fb['created'] < $limit_changed) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -86,7 +86,6 @@ class kolab_activesync extends rcube_plugin
|
||||||
function folder_form($args)
|
function folder_form($args)
|
||||||
{
|
{
|
||||||
$mbox_imap = $args['options']['name'];
|
$mbox_imap = $args['options']['name'];
|
||||||
$myrights = $args['options']['rights'];
|
|
||||||
|
|
||||||
// Edited folder name (empty in create-folder mode)
|
// Edited folder name (empty in create-folder mode)
|
||||||
if (!strlen($mbox_imap)) {
|
if (!strlen($mbox_imap)) {
|
||||||
|
|
|
@ -102,7 +102,6 @@ class kolab_addressbook extends rcube_plugin
|
||||||
public function address_sources($p)
|
public function address_sources($p)
|
||||||
{
|
{
|
||||||
$abook_prio = $this->addressbook_prio();
|
$abook_prio = $this->addressbook_prio();
|
||||||
$undelete = $this->rc->config->get('undo_timeout');
|
|
||||||
|
|
||||||
// Disable all global address books
|
// Disable all global address books
|
||||||
// Assumes that all non-kolab_addressbook sources are global
|
// Assumes that all non-kolab_addressbook sources are global
|
||||||
|
@ -239,7 +238,6 @@ class kolab_addressbook extends rcube_plugin
|
||||||
*/
|
*/
|
||||||
protected function addressbook_list_item($id, $source, &$jsdata, $search_mode = false)
|
protected function addressbook_list_item($id, $source, &$jsdata, $search_mode = false)
|
||||||
{
|
{
|
||||||
$folder = $this->folders[$id];
|
|
||||||
$current = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
|
$current = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
|
||||||
|
|
||||||
if (!$source['virtual']) {
|
if (!$source['virtual']) {
|
||||||
|
@ -433,7 +431,6 @@ class kolab_addressbook extends rcube_plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert to UTF8 and sort
|
// convert to UTF8 and sort
|
||||||
$names = array();
|
|
||||||
foreach ($folders as $folder) {
|
foreach ($folders as $folder) {
|
||||||
// create instance of rcube_contacts
|
// create instance of rcube_contacts
|
||||||
$abook_id = $folder->id;
|
$abook_id = $folder->id;
|
||||||
|
@ -632,7 +629,6 @@ class kolab_addressbook extends rcube_plugin
|
||||||
$props['parent'] = kolab_storage::folder_id($kolab_folder->get_parent(), true);
|
$props['parent'] = kolab_storage::folder_id($kolab_folder->get_parent(), true);
|
||||||
|
|
||||||
$this->rc->output->show_message('kolab_addressbook.book'.$type.'d', 'confirmation');
|
$this->rc->output->show_message('kolab_addressbook.book'.$type.'d', 'confirmation');
|
||||||
$this->rc->output->command('set_env', 'delimiter', $delimiter);
|
|
||||||
$this->rc->output->command('book_update', $props, kolab_storage::folder_id($prop['oldname'], true));
|
$this->rc->output->command('book_update', $props, kolab_storage::folder_id($prop['oldname'], true));
|
||||||
$this->rc->output->send('iframe');
|
$this->rc->output->send('iframe');
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,7 +213,6 @@ class rcube_kolab_contacts extends rcube_addressbook
|
||||||
*/
|
*/
|
||||||
public function get_carddav_url()
|
public function get_carddav_url()
|
||||||
{
|
{
|
||||||
$url = null;
|
|
||||||
$rcmail = rcmail::get_instance();
|
$rcmail = rcmail::get_instance();
|
||||||
if ($template = $rcmail->config->get('kolab_addressbook_carddav_url', null)) {
|
if ($template = $rcmail->config->get('kolab_addressbook_carddav_url', null)) {
|
||||||
return strtr($template, array(
|
return strtr($template, array(
|
||||||
|
@ -443,7 +442,7 @@ class rcube_kolab_contacts extends rcube_addressbook
|
||||||
$this->filter = array('fields' => $fields, 'value' => $value, 'mode' => $mode, 'ids' => array());
|
$this->filter = array('fields' => $fields, 'value' => $value, 'mode' => $mode, 'ids' => array());
|
||||||
|
|
||||||
// search by iterating over all records in dataset
|
// search by iterating over all records in dataset
|
||||||
foreach ($this->dataset as $i => $record) {
|
foreach ($this->dataset as $record) {
|
||||||
$contact = $this->_to_rcube_contact($record);
|
$contact = $this->_to_rcube_contact($record);
|
||||||
$id = $contact['ID'];
|
$id = $contact['ID'];
|
||||||
|
|
||||||
|
|
|
@ -88,8 +88,6 @@ class kolab_auth extends rcube_plugin
|
||||||
*/
|
*/
|
||||||
public function startup($args)
|
public function startup($args)
|
||||||
{
|
{
|
||||||
$rcmail = rcube::get_instance();
|
|
||||||
|
|
||||||
// Check access rights when logged in as another user
|
// Check access rights when logged in as another user
|
||||||
if (!empty($_SESSION['kolab_auth_admin']) && $args['task'] != 'login' && $args['task'] != 'logout') {
|
if (!empty($_SESSION['kolab_auth_admin']) && $args['task'] != 'login' && $args['task'] != 'logout') {
|
||||||
// access to specified task is forbidden,
|
// access to specified task is forbidden,
|
||||||
|
|
|
@ -57,8 +57,6 @@ class kolab_auth_ldap extends rcube_ldap_generic
|
||||||
*/
|
*/
|
||||||
private function _connect()
|
private function _connect()
|
||||||
{
|
{
|
||||||
$rcube = rcube::get_instance();
|
|
||||||
|
|
||||||
// try to connect + bind for every host configured
|
// try to connect + bind for every host configured
|
||||||
// with OpenLDAP 2.x ldap_connect() always succeeds but ldap_bind will fail if host isn't reachable
|
// with OpenLDAP 2.x ldap_connect() always succeeds but ldap_bind will fail if host isn't reachable
|
||||||
// see http://www.php.net/manual/en/function.ldap-connect.php
|
// see http://www.php.net/manual/en/function.ldap-connect.php
|
||||||
|
|
|
@ -30,7 +30,6 @@ class kolab_config extends rcube_plugin
|
||||||
{
|
{
|
||||||
public $task = 'utils';
|
public $task = 'utils';
|
||||||
|
|
||||||
private $enabled;
|
|
||||||
private $config;
|
private $config;
|
||||||
private $dicts = array();
|
private $dicts = array();
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,6 @@ class kolab_delegation_engine
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = $this->list_delegates();
|
$list = $this->list_delegates();
|
||||||
$user = $this->user();
|
|
||||||
|
|
||||||
// add delegate to the list
|
// add delegate to the list
|
||||||
$list = array_keys((array)$list);
|
$list = array_keys((array)$list);
|
||||||
|
@ -448,7 +447,7 @@ class kolab_delegation_engine
|
||||||
// sort users index
|
// sort users index
|
||||||
asort($keys, SORT_LOCALE_STRING);
|
asort($keys, SORT_LOCALE_STRING);
|
||||||
// re-sort users according to index
|
// re-sort users according to index
|
||||||
foreach ($keys as $idx => $val) {
|
foreach (array_keys($keys) as $idx) {
|
||||||
$keys[$idx] = $users[$idx];
|
$keys[$idx] = $users[$idx];
|
||||||
}
|
}
|
||||||
$users = array_values($keys);
|
$users = array_values($keys);
|
||||||
|
|
|
@ -463,7 +463,7 @@ class kolab_files_engine
|
||||||
$inner = $this->rc->gettext('listoptions');
|
$inner = $this->rc->gettext('listoptions');
|
||||||
|
|
||||||
if (is_string($attrib['optionsmenuicon']) && $attrib['optionsmenuicon'] != 'true') {
|
if (is_string($attrib['optionsmenuicon']) && $attrib['optionsmenuicon'] != 'true') {
|
||||||
$inner = html::img(array('src' => $skin_path . $attrib['optionsmenuicon'], 'alt' => $RCMAIL->gettext('listoptions')));
|
$inner = html::img(array('src' => $skin_path . $attrib['optionsmenuicon'], 'alt' => $this->rc->gettext('listoptions')));
|
||||||
}
|
}
|
||||||
|
|
||||||
$list_menu = html::a(array(
|
$list_menu = html::a(array(
|
||||||
|
|
|
@ -893,7 +893,7 @@ class kolab_notes extends rcube_plugin
|
||||||
if (!empty($args['param']['with_notes'])) {
|
if (!empty($args['param']['with_notes'])) {
|
||||||
$uids = explode(',', $args['param']['with_notes']);
|
$uids = explode(',', $args['param']['with_notes']);
|
||||||
$list = $args['param']['notes_list'];
|
$list = $args['param']['notes_list'];
|
||||||
$attachments = array();
|
|
||||||
foreach ($uids as $uid) {
|
foreach ($uids as $uid) {
|
||||||
if ($note = $this->get_note(array('uid' => $uid, 'list' => $list))) {
|
if ($note = $this->get_note(array('uid' => $uid, 'list' => $list))) {
|
||||||
$args['attachments'][] = array(
|
$args['attachments'][] = array(
|
||||||
|
|
|
@ -154,7 +154,7 @@ class kolab_tags_engine
|
||||||
|
|
||||||
// ...filter members by folder/uid prefix
|
// ...filter members by folder/uid prefix
|
||||||
foreach ((array) $tag['members'] as $idx => $member) {
|
foreach ((array) $tag['members'] as $idx => $member) {
|
||||||
foreach ($filter as $folder => $members) {
|
foreach ($filter as $members) {
|
||||||
// list of prefixes
|
// list of prefixes
|
||||||
if (is_array($members)) {
|
if (is_array($members)) {
|
||||||
foreach ($members as $message) {
|
foreach ($members as $message) {
|
||||||
|
|
|
@ -353,7 +353,7 @@ class libcalendaring_itip
|
||||||
if ($existing) {
|
if ($existing) {
|
||||||
$rsvp = $event['rsvp'];
|
$rsvp = $event['rsvp'];
|
||||||
$emails = $this->lib->get_user_emails();
|
$emails = $this->lib->get_user_emails();
|
||||||
foreach ($existing['attendees'] as $i => $attendee) {
|
foreach ($existing['attendees'] as $attendee) {
|
||||||
if ($attendee['email'] && in_array(strtolower($attendee['email']), $emails)) {
|
if ($attendee['email'] && in_array(strtolower($attendee['email']), $emails)) {
|
||||||
$status = strtoupper($attendee['status']);
|
$status = strtoupper($attendee['status']);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -318,7 +318,7 @@ class libvcalendar implements Iterator
|
||||||
if (!$seen[$object['uid']]++) {
|
if (!$seen[$object['uid']]++) {
|
||||||
// parse recurrence exceptions
|
// parse recurrence exceptions
|
||||||
if ($object['recurrence']) {
|
if ($object['recurrence']) {
|
||||||
foreach ($vobject->children as $i => $component) {
|
foreach ($vobject->children as $component) {
|
||||||
if ($component->name == 'VEVENT' && isset($component->{'RECURRENCE-ID'})) {
|
if ($component->name == 'VEVENT' && isset($component->{'RECURRENCE-ID'})) {
|
||||||
$object['recurrence']['EXCEPTIONS'][] = $this->_to_array($component);
|
$object['recurrence']['EXCEPTIONS'][] = $this->_to_array($component);
|
||||||
}
|
}
|
||||||
|
@ -391,7 +391,6 @@ class libvcalendar implements Iterator
|
||||||
}
|
}
|
||||||
|
|
||||||
// map other attributes to internal fields
|
// map other attributes to internal fields
|
||||||
$_attendees = array();
|
|
||||||
foreach ($ve->children as $prop) {
|
foreach ($ve->children as $prop) {
|
||||||
if (!($prop instanceof VObject\Property))
|
if (!($prop instanceof VObject\Property))
|
||||||
continue;
|
continue;
|
||||||
|
@ -857,7 +856,6 @@ class libvcalendar implements Iterator
|
||||||
*/
|
*/
|
||||||
public function export($objects, $method = null, $write = false, $get_attachment = false, $with_timezones = true)
|
public function export($objects, $method = null, $write = false, $get_attachment = false, $with_timezones = true)
|
||||||
{
|
{
|
||||||
$memory_limit = parse_bytes(ini_get('memory_limit'));
|
|
||||||
$this->method = $method;
|
$this->method = $method;
|
||||||
|
|
||||||
// encapsulate in VCALENDAR container
|
// encapsulate in VCALENDAR container
|
||||||
|
@ -1095,10 +1093,13 @@ class libvcalendar implements Iterator
|
||||||
if ($event['comment'])
|
if ($event['comment'])
|
||||||
$ve->add('COMMENT', $event['comment']);
|
$ve->add('COMMENT', $event['comment']);
|
||||||
|
|
||||||
|
$memory_limit = parse_bytes(ini_get('memory_limit'));
|
||||||
|
|
||||||
// export attachments
|
// export attachments
|
||||||
if (!empty($event['attachments'])) {
|
if (!empty($event['attachments'])) {
|
||||||
foreach ((array)$event['attachments'] as $attach) {
|
foreach ((array)$event['attachments'] as $attach) {
|
||||||
// check available memory and skip attachment export if we can't buffer it
|
// check available memory and skip attachment export if we can't buffer it
|
||||||
|
// @todo: use rcube_utils::mem_check()
|
||||||
if (is_callable($get_attachment) && $memory_limit > 0 && ($memory_used = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024)
|
if (is_callable($get_attachment) && $memory_limit > 0 && ($memory_used = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024)
|
||||||
&& $attach['size'] && $memory_used + $attach['size'] * 3 > $memory_limit) {
|
&& $attach['size'] && $memory_used + $attach['size'] * 3 > $memory_limit) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -36,7 +36,7 @@ class kolab_bonnie_api
|
||||||
*/
|
*/
|
||||||
public function __construct($config)
|
public function __construct($config)
|
||||||
{
|
{
|
||||||
$this->config = $confg;
|
$this->config = $config;
|
||||||
|
|
||||||
$this->client = new kolab_bonnie_api_client($config['uri'], $config['timeout'] ?: 5, (bool)$config['debug']);
|
$this->client = new kolab_bonnie_api_client($config['uri'], $config['timeout'] ?: 5, (bool)$config['debug']);
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ class kolab_format_event extends kolab_format_xcal
|
||||||
$vexceptions = new vectorevent;
|
$vexceptions = new vectorevent;
|
||||||
foreach((array)$object['recurrence']['EXCEPTIONS'] as $exception) {
|
foreach((array)$object['recurrence']['EXCEPTIONS'] as $exception) {
|
||||||
$exevent = new kolab_format_event;
|
$exevent = new kolab_format_event;
|
||||||
$exevent->set($this->compact_exception($exception, $object)); // only save differing values
|
$exevent->set($this->compact_exception($exception)); // only save differing values
|
||||||
$exevent->obj->setRecurrenceID(self::get_datetime($exception['start'], null, true), (bool)$exception['thisandfuture']);
|
$exevent->obj->setRecurrenceID(self::get_datetime($exception['start'], null, true), (bool)$exception['thisandfuture']);
|
||||||
$vexceptions->push($exevent->obj);
|
$vexceptions->push($exevent->obj);
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ class kolab_format_event extends kolab_format_xcal
|
||||||
/**
|
/**
|
||||||
* Remove some attributes from the exception container
|
* Remove some attributes from the exception container
|
||||||
*/
|
*/
|
||||||
private function compact_exception($exception, $master)
|
private function compact_exception($exception)
|
||||||
{
|
{
|
||||||
$forbidden = array('recurrence','organizer','attendees','sequence');
|
$forbidden = array('recurrence','organizer','attendees','sequence');
|
||||||
|
|
||||||
|
|
|
@ -409,7 +409,7 @@ class kolab_storage
|
||||||
|
|
||||||
// pass active state to new folder name
|
// pass active state to new folder name
|
||||||
if ($success && $active) {
|
if ($success && $active) {
|
||||||
self::set_state($oldnam, false);
|
self::set_state($oldname, false);
|
||||||
self::set_state($newname, true);
|
self::set_state($newname, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1086,7 +1086,7 @@ class kolab_storage
|
||||||
return $types[self::CTYPE_KEY_PRIVATE];
|
return $types[self::CTYPE_KEY_PRIVATE];
|
||||||
}
|
}
|
||||||
else if (!empty($types[self::CTYPE_KEY])) {
|
else if (!empty($types[self::CTYPE_KEY])) {
|
||||||
list($ctype, $suffix) = explode('.', $types[self::CTYPE_KEY]);
|
list($ctype, ) = explode('.', $types[self::CTYPE_KEY]);
|
||||||
return $ctype;
|
return $ctype;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -1464,7 +1464,7 @@ class kolab_storage
|
||||||
$user_attrib = self::$config->get('kolab_users_id_attrib', self::$config->get('kolab_auth_login', 'mail'));
|
$user_attrib = self::$config->get('kolab_users_id_attrib', self::$config->get('kolab_auth_login', 'mail'));
|
||||||
|
|
||||||
array_walk($results, function(&$user, $dn) use ($root, $user_attrib) {
|
array_walk($results, function(&$user, $dn) use ($root, $user_attrib) {
|
||||||
list($localpart, $domain) = explode('@', $user[$user_attrib]);
|
list($localpart, ) = explode('@', $user[$user_attrib]);
|
||||||
$user['kolabtargetfolder'] = $root . $localpart;
|
$user['kolabtargetfolder'] = $root . $localpart;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -431,7 +431,7 @@ class kolab_storage_cache
|
||||||
/**
|
/**
|
||||||
* Remove all objects from local cache
|
* Remove all objects from local cache
|
||||||
*/
|
*/
|
||||||
public function purge($type = null)
|
public function purge()
|
||||||
{
|
{
|
||||||
if (!$this->ready) {
|
if (!$this->ready) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -360,7 +360,7 @@ class kolab_storage_folder extends kolab_storage_folder_api
|
||||||
$object['_formatobj']->get_attachments($object);
|
$object['_formatobj']->get_attachments($object);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($object['_attachments'] as $k => $attach) {
|
foreach ($object['_attachments'] as $attach) {
|
||||||
if ($attach['id'] == $part) {
|
if ($attach['id'] == $part) {
|
||||||
if ($print) echo $attach['content'];
|
if ($print) echo $attach['content'];
|
||||||
else if ($fp) fwrite($fp, $attach['content']);
|
else if ($fp) fwrite($fp, $attach['content']);
|
||||||
|
@ -882,7 +882,7 @@ class kolab_storage_folder extends kolab_storage_folder_api
|
||||||
if (!empty($object['_attachments']) && ($mem_limit = parse_bytes(ini_get('memory_limit'))) > 0) {
|
if (!empty($object['_attachments']) && ($mem_limit = parse_bytes(ini_get('memory_limit'))) > 0) {
|
||||||
$memory = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024; // safe value: 16MB
|
$memory = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024; // safe value: 16MB
|
||||||
|
|
||||||
foreach ($object['_attachments'] as $id => $attachment) {
|
foreach ($object['_attachments'] as $attachment) {
|
||||||
$memory += $attachment['size'];
|
$memory += $attachment['size'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
$prefs = $this->rc->config->get('kolab_tasklists', array());
|
$prefs = $this->rc->config->get('kolab_tasklists', array());
|
||||||
|
|
||||||
foreach ($folders as $folder) {
|
foreach ($folders as $folder) {
|
||||||
$tasklist = $this->folder_props($folder, $delim, $prefs);
|
$tasklist = $this->folder_props($folder, $prefs);
|
||||||
|
|
||||||
$this->lists[$tasklist['id']] = $tasklist;
|
$this->lists[$tasklist['id']] = $tasklist;
|
||||||
$this->folders[$tasklist['id']] = $folder;
|
$this->folders[$tasklist['id']] = $folder;
|
||||||
|
@ -103,7 +103,7 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
/**
|
/**
|
||||||
* Derive list properties from the given kolab_storage_folder object
|
* Derive list properties from the given kolab_storage_folder object
|
||||||
*/
|
*/
|
||||||
protected function folder_props($folder, $delim, $prefs)
|
protected function folder_props($folder, $prefs)
|
||||||
{
|
{
|
||||||
if ($folder->get_namespace() == 'personal') {
|
if ($folder->get_namespace() == 'personal') {
|
||||||
$norename = false;
|
$norename = false;
|
||||||
|
@ -179,7 +179,7 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
|
|
||||||
$lists = array();
|
$lists = array();
|
||||||
foreach ($folders as $folder) {
|
foreach ($folders as $folder) {
|
||||||
$list_id = $folder->id; #kolab_storage::folder_id($folder->name);
|
$list_id = $folder->id; // kolab_storage::folder_id($folder->name);
|
||||||
$imap_path = explode($delim, $folder->name);
|
$imap_path = explode($delim, $folder->name);
|
||||||
|
|
||||||
// find parent
|
// find parent
|
||||||
|
@ -225,7 +225,7 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!$this->lists[$list_id]) {
|
if (!$this->lists[$list_id]) {
|
||||||
$this->lists[$list_id] = $this->folder_props($folder, $delim, $prefs);
|
$this->lists[$list_id] = $this->folder_props($folder, $prefs);
|
||||||
$this->folders[$list_id] = $folder;
|
$this->folders[$list_id] = $folder;
|
||||||
}
|
}
|
||||||
$this->lists[$list_id]['parent'] = $parent_id;
|
$this->lists[$list_id]['parent'] = $parent_id;
|
||||||
|
@ -249,7 +249,7 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
$folder = kolab_storage::get_folder(kolab_storage::id_decode($id));
|
$folder = kolab_storage::get_folder(kolab_storage::id_decode($id));
|
||||||
if ($folder->type) {
|
if ($folder->type) {
|
||||||
$this->folders[$id] = $folder;
|
$this->folders[$id] = $folder;
|
||||||
$this->lists[$id] = $this->folder_props($folder, $this->rc->get_storage()->get_hierarchy_delimiter(), $this->rc->config->get('kolab_tasklists', array()));
|
$this->lists[$id] = $this->folder_props($folder, $this->rc->config->get('kolab_tasklists', array()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$folder = kolab_storage::get_folder($folder);
|
$folder = kolab_storage::get_folder($folder);
|
||||||
$prop += $this->folder_props($folder, $this->rc->get_storage()->get_hierarchy_delimiter(), array());
|
$prop += $this->folder_props($folder, array());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $id;
|
return $id;
|
||||||
|
@ -413,13 +413,11 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
$this->search_more_results = false;
|
$this->search_more_results = false;
|
||||||
$this->lists = $this->folders = array();
|
$this->lists = $this->folders = array();
|
||||||
|
|
||||||
$delim = $this->rc->get_storage()->get_hierarchy_delimiter();
|
|
||||||
|
|
||||||
// find unsubscribed IMAP folders that have "event" type
|
// find unsubscribed IMAP folders that have "event" type
|
||||||
if ($source == 'folders') {
|
if ($source == 'folders') {
|
||||||
foreach ((array)kolab_storage::search_folders('task', $query, array('other')) as $folder) {
|
foreach ((array)kolab_storage::search_folders('task', $query, array('other')) as $folder) {
|
||||||
$this->folders[$folder->id] = $folder;
|
$this->folders[$folder->id] = $folder;
|
||||||
$this->lists[$folder->id] = $this->folder_props($folder, $delim, array());
|
$this->lists[$folder->id] = $this->folder_props($folder, array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// search other user's namespace via LDAP
|
// search other user's namespace via LDAP
|
||||||
|
@ -435,11 +433,11 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
if (count($folders)) {
|
if (count($folders)) {
|
||||||
$userfolder = new kolab_storage_folder_user($user['kolabtargetfolder'], '', $user);
|
$userfolder = new kolab_storage_folder_user($user['kolabtargetfolder'], '', $user);
|
||||||
$this->folders[$userfolder->id] = $userfolder;
|
$this->folders[$userfolder->id] = $userfolder;
|
||||||
$this->lists[$userfolder->id] = $this->folder_props($userfolder, $delim, array());
|
$this->lists[$userfolder->id] = $this->folder_props($userfolder, array());
|
||||||
|
|
||||||
foreach ($folders as $folder) {
|
foreach ($folders as $folder) {
|
||||||
$this->folders[$folder->id] = $folder;
|
$this->folders[$folder->id] = $folder;
|
||||||
$this->lists[$folder->id] = $this->folder_props($folder, $delim, array());
|
$this->lists[$folder->id] = $this->folder_props($folder, array());
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1605,7 +1605,7 @@ class tasklist extends rcube_plugin
|
||||||
/**
|
/**
|
||||||
* Resolve the email message reference from the given URI
|
* Resolve the email message reference from the given URI
|
||||||
*/
|
*/
|
||||||
public function get_message_reference($uri, $resolve = false)
|
public function get_message_reference($uri)
|
||||||
{
|
{
|
||||||
if (strpos($uri, 'imap:///') === 0) {
|
if (strpos($uri, 'imap:///') === 0) {
|
||||||
$url = parse_url(substr($uri, 8));
|
$url = parse_url(substr($uri, 8));
|
||||||
|
@ -1657,7 +1657,7 @@ class tasklist extends rcube_plugin
|
||||||
|
|
||||||
if ($uid && $mime_id) {
|
if ($uid && $mime_id) {
|
||||||
$part = $imap->get_message_part($uid, $mime_id);
|
$part = $imap->get_message_part($uid, $mime_id);
|
||||||
$headers = $imap->get_message_headers($uid);
|
// $headers = $imap->get_message_headers($uid);
|
||||||
|
|
||||||
if ($part->ctype_parameters['charset']) {
|
if ($part->ctype_parameters['charset']) {
|
||||||
$charset = $part->ctype_parameters['charset'];
|
$charset = $part->ctype_parameters['charset'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue