Projects
Kolab:3.4:Updates
kolab-syncroton
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 14
View file
kolab-syncroton.spec
Changed
@@ -13,7 +13,7 @@ %global _ap_sysconfdir %{_sysconfdir}/%{httpd_name} Name: kolab-syncroton -Version: 2.2.0 +Version: 2.2.1 Release: 1%{?dist} Summary: ActiveSync for Kolab Groupware @@ -154,6 +154,9 @@ %attr(0770,%{httpd_user},%{httpd_group}) %{_var}/log/%{name} %changelog +* Mon Oct 14 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.2.1-1 +- New upstream version 2.2.1 + * Sun Sep 8 2013 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 2.2.0-1 - Release version 2.2.0
View file
add-system-table.patch
Deleted
@@ -1,19 +0,0 @@ -Roundcube core table should exist if we're using the same database - ---- a/docs/SQL/mysql/2013011600.sql -+++ b/docs/SQL/mysql/2013011600.sql -@@ -7,3 +7,14 @@ - KEY `syncroton_modseq::device_id` (`device_id`), - CONSTRAINT `syncroton_modseq::device_id--syncroton_device::id` FOREIGN KEY (`device_id`) REFERENCES `syncroton_device` (`id`) ON DELETE CASCADE ON UPDATE CASCADE - ) ENGINE=InnoDB; -+ -+-- Roundcube core table should exist if we're using the same database -+ -+CREATE TABLE IF NOT EXISTS `system` ( -+ `name` varchar(64) NOT NULL, -+ `value` mediumtext, -+ PRIMARY KEY(`name`) -+) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; -+ -+INSERT INTO `system` (`name`, `value`) VALUES ('syncroton-version', '2013011600'); -+
View file
rcube-imap-murder-quoting.patch
Deleted
@@ -1,37 +0,0 @@ -diff -ur kolab-syncroton.orig/lib/ext/Roundcube/rcube_imap_generic.php kolab-syncroton/lib/ext/Roundcube/rcube_imap_generic.php ---- kolab-syncroton.orig/lib/ext/Roundcube/rcube_imap_generic.php 2012-11-26 04:58:14.000000000 -0600 -+++ kolab-syncroton/lib/ext/Roundcube/rcube_imap_generic.php 2013-02-12 08:58:03.000000000 -0600 -@@ -52,6 +52,8 @@ - '*' => '\\*', - ); - -+ public static $mupdate; -+ - private $fp; - private $host; - private $logged = false; -@@ -3071,6 +3073,12 @@ - } - - foreach ($data as $entry) { -+ // If we are running in a murder topology, the entry[2] string needs -+ // to be escaped. -+ if (self::$mupdate) { -+ $entry[2] = addcslashes($entry[2], '\\"'); -+ } -+ - // ANNOTATEMORE drafts before version 08 require quoted parameters - $entries[] = sprintf('%s (%s %s)', $this->escape($entry[0], true), - $this->escape($entry[1], true), $this->escape($entry[2], true)); -@@ -3620,6 +3628,10 @@ - $this->prefs['literal+'] = true; - } - -+ if (preg_match('/(\[| )MUPDATE=.*/', $str)) { -+ self::$mupdate = true; -+ } -+ - if ($trusted) { - $this->capability_readed = true; - } -
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +kolab-syncroton (2.2.1-0~kolab1) unstable; urgency=low + + * Check in version 2.2.1 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Mon, 14 Oct 2013 15:13:40 +0200 + kolab-syncroton (2.2.0-1) unstable; urgency=low * Check in version 2.2.0
View file
kolab-syncroton-2.2.0.tar.gz/lib/ext/Roundcube/rcube_imap_generic.php -> kolab-syncroton-2.2.1.tar.gz/lib/ext/Roundcube/rcube_imap_generic.php
Changed
@@ -48,6 +48,8 @@ '*' => '\\*', ); + public static $mupdate; + private $fp; private $host; private $logged = false; @@ -3137,6 +3139,12 @@ } foreach ($data as $entry) { + // If we are running in a murder topology, the entry[2] string needs + // to be escaped. + if (self::$mupdate) { + $entry[2] = addcslashes($entry[2], '\\"'); + } + // ANNOTATEMORE drafts before version 08 require quoted parameters $entries[] = sprintf('%s (%s %s)', $this->escape($entry[0], true), $this->escape($entry[1], true), $this->escape($entry[2], true)); @@ -3701,6 +3709,10 @@ $this->prefs['literal+'] = true; } + if (preg_match('/(\[| )MUPDATE=.*/', $str)) { + self::$mupdate = true; + } + if ($trusted) { $this->capability_readed = true; }
View file
kolab-syncroton-2.2.0.tar.gz/lib/ext/Syncroton/Server.php -> kolab-syncroton-2.2.1.tar.gz/lib/ext/Syncroton/Server.php
Changed
@@ -172,9 +172,7 @@ if ($response instanceof DOMDocument) { if ($this->_logger instanceof Zend_Log) { - $response->formatOutput = true; - $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " xml response:\n" . $response->saveXML()); - $response->formatOutput = false; + $this->_logDomDocument(Zend_Log::DEBUG, $response, __METHOD__, __LINE__); } if (isset($command) && $command instanceof Syncroton_Command_ICommand) { @@ -190,7 +188,7 @@ } catch (Syncroton_Wbxml_Exception $swe) { if ($this->_logger instanceof Zend_Log) { $this->_logger->err(__METHOD__ . '::' . __LINE__ . " Could not encode output: " . $swe); - $this->_logger->err(__METHOD__ . '::' . __LINE__ . " xml response:\n" . $response->saveXML()); + $this->_logDomDocument(Zend_Log::ERR, $response, __METHOD__, __LINE__); } header("HTTP/1.1 500 Internal server error"); @@ -227,7 +225,7 @@ echo $header; } - + // output body rewind($outputStream); fpassthru($outputStream); @@ -240,7 +238,37 @@ } } } - } + } + + /** + * write (possible big) DOMDocument in smaller chunks to log file + * + * @param unknown $priority + * @param DOMDocument $dom + * @param string $method + * @param int $line + */ + protected function _logDomDocument($priority, DOMDocument $dom, $method, $line) + { + $loops = 0; + + $tempStream = fopen('php://temp/maxmemory:5242880', 'r+'); + + $dom->formatOutput = true; + fwrite($tempStream, $dom->saveXML()); + $dom->formatOutput = false; + + rewind($tempStream); + + // log data in 1MByte chunks + while (!feof($tempStream)) { + $this->_logger->log($method . '::' . $line . " xml response($loops):\n" . fread($tempStream, 1048576), $priority); + + $loops++; + } + + fclose($tempStream); + } /** * return request params
View file
kolab-syncroton-2.2.0.tar.gz/lib/ext/Syncroton/Wbxml/Abstract.php -> kolab-syncroton-2.2.1.tar.gz/lib/ext/Syncroton/Wbxml/Abstract.php
Changed
@@ -151,12 +151,27 @@ protected function _getOpaque($_length) { - $string = fread($this->_stream, $_length); - - if($string === false) { - throw new Syncroton_Wbxml_Exception("failed reading opaque data"); + $string = ''; + + // it might happen that not complete data is read from stream. + // loop until all data is read or EOF + while ($_length) { + $chunk = fread($this->_stream, $_length); + + if ($chunk === false) { + throw new Syncroton_Wbxml_Exception("failed reading opaque data"); + } + + if ($len = strlen($chunk)) { + $string .= $chunk; + $_length -= $len; + } + + if (feof($this->_stream)) { + break; + } } - + return $string; }
View file
kolab-syncroton-2.2.0.tar.gz/lib/ext/Syncroton/Wbxml/Decoder.php -> kolab-syncroton-2.2.1.tar.gz/lib/ext/Syncroton/Wbxml/Decoder.php
Changed
@@ -171,28 +171,33 @@ // get rid of bit 7+8 $tagHexCode = $byte & 0x3F; - $tag = $this->_codePage->getTag($tagHexCode); - $nameSpace = $this->_codePage->getNameSpace(); + try { + $tag = $this->_codePage->getTag($tagHexCode); + } catch (Syncroton_Wbxml_Exception $swe) { + // tag can not be converted to ASCII name + $tag = sprintf('unknown tag 0x%x', $tagHexCode); + } + $nameSpace = $this->_codePage->getNameSpace(); $codePageName = $this->_codePage->getCodePageName(); #echo "Tag: $nameSpace:$tag\n"; - if($node === NULL) { + if ($node === NULL) { // create the domdocument - $node = $this->_createDomDocument($nameSpace, $tag); + $node = $this->_createDomDocument($nameSpace, $tag); $newNode = $node->documentElement; } else { - if(!$this->_dom->isDefaultNamespace($nameSpace)) { + if (!$this->_dom->isDefaultNamespace($nameSpace)) { $this->_dom->documentElement->setAttribute('xmlns:' . $codePageName, $nameSpace); } $newNode = $node->appendChild($this->_dom->createElementNS('uri:' . $codePageName, $tag)); } - if($tagHasAttributes) { + if ($tagHasAttributes) { $attributes = $this->_getAttributes(); } - if($tagHasContent == true) { + if ($tagHasContent == true) { $node = $newNode; $openTags++; }
View file
kolab-syncroton-2.2.0.tar.gz/lib/ext/Syncroton/Wbxml/Encoder.php -> kolab-syncroton-2.2.1.tar.gz/lib/ext/Syncroton/Wbxml/Encoder.php
Changed
@@ -151,6 +151,10 @@ { $_dom->formatOutput = false; + $tempStream = fopen('php://temp/maxmemory:5242880', 'r+'); + fwrite($tempStream, $_dom->saveXML()); + rewind($tempStream); + $this->_initialize($_dom); $parser = xml_parser_create_ns($this->_charSet, ';'); @@ -159,14 +163,22 @@ xml_set_character_data_handler($parser, '_handleCharacters'); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - if (!xml_parse($parser, $_dom->saveXML())) { - #file_put_contents(tempnam(sys_get_temp_dir(), "xmlerrors"), $_dom->saveXML()); - throw new Syncroton_Wbxml_Exception(sprintf('XML error: %s at line %d', - xml_error_string(xml_get_error_code($parser)), - xml_get_current_line_number($parser) - )); + while (!feof($tempStream)) { + if (!xml_parse($parser, fread($tempStream, 1048576), feof($tempStream))) { + // uncomment to write xml document to file + #rewind($tempStream); + #$xmlStream = fopen(tempnam(sys_get_temp_dir(), "xmlerrors"), 'r+'); + #stream_copy_to_stream($tempStream, $xmlStream); + #fclose($xmlStream); + + throw new Syncroton_Wbxml_Exception(sprintf('XML error: %s at line %d', + xml_error_string(xml_get_error_code($parser)), + xml_get_current_line_number($parser) + )); + } } + fclose($tempStream); xml_parser_free($parser); }
View file
kolab-syncroton-2.2.0.tar.gz/lib/kolab_sync.php -> kolab-syncroton-2.2.1.tar.gz/lib/kolab_sync.php
Changed
@@ -43,7 +43,7 @@ public $user; const CHARSET = 'UTF-8'; - const VERSION = "2.2.0"; + const VERSION = "2.2.1"; /**
View file
kolab-syncroton-2.2.0.tar.gz/lib/kolab_sync_data.php -> kolab-syncroton-2.2.1.tar.gz/lib/kolab_sync_data.php
Changed
@@ -875,7 +875,7 @@ /** * Returns ActiveSync settings of specified folder * - * @param string $name Folder name (UTF7-IMAP) + * @param string $name Folder name (UTF7-IMAP) * * @return array Folder settings */ @@ -896,6 +896,24 @@ } /** + * Returns real folder name for specified folder ID + */ + protected function getFolderName($folderid) + { + if ($folderid == $this->defaultRootFolder) { + $default = $this->getDefaultFolder(); + + if (!is_array($default)) { + return null; + } + + $folderid = isset($default['realid']) ? $default['realid'] : $default['serverId']; + } + + return $this->backend->folder_id2name($folderid, $this->device->deviceid); + } + + /** * Convert contact from xml to kolab format * * @param Syncroton_Model_IEntry $data Contact data
View file
kolab-syncroton-2.2.0.tar.gz/lib/kolab_sync_data_calendar.php -> kolab-syncroton-2.2.1.tar.gz/lib/kolab_sync_data_calendar.php
Changed
@@ -326,8 +326,8 @@ */ public function toKolab(Syncroton_Model_IEntry $data, $folderid, $entry = null, $timezone = null) { - $foldername = $this->backend->folder_id2name($folderid, $this->device->deviceid); $event = !empty($entry) ? $entry : array(); + $foldername = isset($event['_mailbox']) ? $event['_mailbox'] : $this->getFolderName($folderid); $config = $this->getFolderConfig($foldername); $is_exception = $data instanceof Syncroton_Model_EventException;
View file
kolab-syncroton-2.2.0.tar.gz/lib/kolab_sync_data_contacts.php -> kolab-syncroton-2.2.1.tar.gz/lib/kolab_sync_data_contacts.php
Changed
@@ -49,9 +49,9 @@ 'children' => 'children', 'companyName' => 'organization', 'department' => 'department', - 'email1Address' => 'email:0', - 'email2Address' => 'email:1', - 'email3Address' => 'email:2', + //'email1Address' => 'email:0', + //'email2Address' => 'email:1', + //'email3Address' => 'email:2', //'fileAs' => 'fileas', //@TODO: ? 'firstName' => 'firstname', //'home2PhoneNumber' => 'home2phonenumber', @@ -167,6 +167,13 @@ $result[$key] = $value; } + // email address(es): email1Address, email2Address, email3Address + for ($x=0; $x<3; $x++) { + if (!empty($data['email'][$x]) && !empty($data['email'][$x]['address'])) { + $result['email' . ($x+1) . 'Address'] = $data['email'][$x]['address']; + } + } + return new Syncroton_Model_Contact($result); } @@ -181,7 +188,7 @@ */ public function toKolab(Syncroton_Model_IEntry $data, $folderId, $entry = null) { - $contact = !empty($entry) ? $entry : array(); + $contact = !empty($entry) ? $entry : array(); // Contacts namespace fields foreach ($this->mapping as $key => $name) { @@ -195,16 +202,6 @@ } break; - case 'email:0': - case 'email:1': - case 'email:2': - // android send email address as - // Lars Kneschke <l.kneschke@metaways.de> - if (preg_match('/(.*)<(.+@[^@]+)>/', $value, $matches)) { - $value = trim($matches[2]); - } - break; - case 'website.homepage.url': // remove facebook urls if (preg_match('/^fb:\/\//', $value)) { @@ -231,6 +228,29 @@ $this->setKolabDataItem($contact, $name, $value); } + // email address(es): email1Address, email2Address, email3Address + $emails = array(); + for ($x=0; $x<3; $x++) { + $key = 'email' . ($x+1) . 'Address'; + if ($value = $data->$key) { + // Android sends email address as: Lars Kneschke <l.kneschke@metaways.de> + if (preg_match('/(.*)<(.+@[^@]+)>/', $value, $matches)) { + $value = trim($matches[2]); + } + + // try to find address type, at least we can do this if + // address wasn't changed + $type = ''; + foreach ((array)$contact['email'] as $email) { + if ($email['address'] == $value) { + $type = $email['type']; + } + } + $emails[] = array('address' => $value, 'type' => $type); + } + } + $contact['email'] = $emails; + return $contact; }
View file
kolab-syncroton-2.2.0.tar.gz/lib/kolab_sync_data_tasks.php -> kolab-syncroton-2.2.1.tar.gz/lib/kolab_sync_data_tasks.php
Changed
@@ -108,7 +108,7 @@ */ public function getEntry(Syncroton_Model_SyncCollection $collection, $serverId, $as_array = false) { - $task = is_array($serverId) ? $serverId : $this->getObject($collection->collectionId, $serverId); + $task = is_array($serverId) ? $serverId : $this->getObject($collection->collectionId, $serverId); $config = $this->getFolderConfig($task['_mailbox']); $result = array(); @@ -168,8 +168,8 @@ */ public function toKolab(Syncroton_Model_IEntry $data, $folderid, $entry = null) { - $foldername = $this->backend->folder_id2name($folderid, $this->device->deviceid); - $task = !empty($entry) ? $entry : array(); + $task = !empty($entry) ? $entry : array(); + $foldername = isset($task['_mailbox']) ? $task['_mailbox'] : $this->getFolderName($folderid); $config = $this->getFolderConfig($foldername); $task['allday'] = 0;
View file
kolab-syncroton-2.2.0.tar.gz/lib/kolab_sync_logger.php -> kolab-syncroton-2.2.1.tar.gz/lib/kolab_sync_logger.php
Changed
@@ -51,8 +51,8 @@ /** * Message logger * - * @param string $message Log message - * @param int $mode Message severity + * @param string $message Log message + * @param int|string $method Message severity */ public function log($message, $method) { @@ -60,7 +60,18 @@ $logfile = $rcube->config->get('activesync_log_file'); $format = $rcube->config->get('log_date_format', 'd-M-Y H:i:s O'); $log_dir = $rcube->config->get('log_dir'); - $mode = $this->_priorities[$method]; + + if (is_numeric($method)) { + $mode = $method; + $method = array_search($method, $this->_priorities); + } + else { + $mode = $this->_priorities[$method]; + } + + if ($mode > self::$mode) { + return; + } // if log_file is configured all logs will go to it // otherwise use separate file for info/debug and warning/error
View file
kolab-syncroton.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-syncroton Binary: kolab-syncroton Architecture: all -Version: 2.2.0-1 +Version: 2.2.1-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org/ @@ -12,5 +12,5 @@ Package-List: kolab-syncroton deb utils extra Files: - 00000000000000000000000000000000 0 kolab-syncroton-2.2.0.tar.gz + 00000000000000000000000000000000 0 kolab-syncroton-2.2.1.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.