Skip to content

Commit a6ab8e6

Browse files
committed
UPgraded to z-push 2.6.1
1 parent 6beccbd commit a6ab8e6

40 files changed

+935
-3397
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
- Multi instance: Only create studio package folder if module is enabled for the instance.
33
- Core: Fixed custom fields not displaying in grid when an entity field was present
44
- Core: Smaller core_search.keywords key length to fix too large index error.
5+
- Core: Z-push upgraded to 2.6.1
6+
- Core: Fixed stringstreamwrapper error with z-push
57

68
15-12-2020 6.4.201
79
- Core: Fixed permission denied error when linking

www/go/base/mail/MimeDecode.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@ function _decode($headers, $body, $default_ctype = 'text/plain')
318318
for ($i = 0; $i < count($parts); $i++) {
319319
list($part_header, $part_body) = $this->_splitBodyHeader($parts[$i]);
320320
$part = $this->_decode($part_header, $part_body, $default_ctype);
321-
if($part === false)
322-
$part = $this->raiseError($this->_error);
321+
if($part === false) {
322+
throw new \Exception($this->_error);
323+
}
323324
$return->parts[] = $part;
324325
}
325326
break;

www/modules/z-push/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
define("GO_NO_SESSION", true);
2626
//require Group-Office framework
2727
if(!class_exists('GO'))
28-
require_once("../../GO.php");
28+
require_once(dirname(dirname(__DIR__)) . "/GO.php");
2929

3030
/**********************************************************************************
3131
* Default settings

www/modules/z-push/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
define("ZPUSH_VERSION", "2.5.2");
2+
define("ZPUSH_VERSION", "2.6.1");
33
define("ZPUSH_DIR", __DIR__ . "/vendor/z-push/");
44

55
require(ZPUSH_DIR . 'vendor/autoload.php');

www/modules/z-push/vendor/z-push/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

www/modules/z-push/vendor/z-push/autodiscover/autodiscover.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private function getIncomingXml() {
174174
}
175175

176176
if (strcasecmp($xml->Request->AcceptableResponseSchema, ZPushAutodiscover::ACCEPTABLERESPONSESCHEMAMOBILESYNC) != 0) {
177-
throw new FatalException(sprintf('Request for a responseschema that is not supported (only mobilesync is supported): %s', $xml->Request->AcceptableResponseSchema));
177+
throw new BadRequestException(sprintf('Request for a responseschema that is not supported (only mobilesync is supported): %s', $xml->Request->AcceptableResponseSchema));
178178
}
179179

180180
return $xml;

www/modules/z-push/vendor/z-push/backend/caldav/caldav.php

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ public function GetMessageList($folderid, $cutoffdate) {
219219

220220
$path = $this->_caldav_path . substr($folderid, 1) . "/";
221221
if ($folderid[0] == "C") {
222-
$msgs = $this->_caldav->GetEvents($begin, $finish, $path);
222+
$msgs = $this->_caldav->GetEventsList($begin, $finish, $path);
223223
}
224224
else {
225-
$msgs = $this->_caldav->GetTodos($begin, $finish, false, false, $path);
225+
$msgs = $this->_caldav->GetTodosList($begin, $finish, false, false, $path);
226226
}
227227

228228
$messages = array();
@@ -240,8 +240,16 @@ public function GetMessageList($folderid, $cutoffdate) {
240240
*/
241241
public function GetMessage($folderid, $id, $contentparameters) {
242242
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendCalDAV->GetMessage('%s','%s')", $folderid, $id));
243-
$data = $this->_collection[$id]['data'];
244-
243+
$path = $this->_caldav_path . substr($folderid, 1) . "/";
244+
$href = $path . $id;
245+
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendCalDAV->GetMessage Querying server for message with href '%s' in folder '%s'", $href, $path));
246+
$messages = $this->_caldav->CalendarMultiget( array( $href ), $path );
247+
if (!isset($messages[$href]) || $messages[$href] == '') {
248+
//we don't have any ical information, return false so that the diff backend raises an exception
249+
return false;
250+
}
251+
$data = $messages[ $href ];
252+
unset ($messages, $href);
245253
if ($folderid[0] == "C") {
246254
return $this->_ParseVEventToAS($data, $contentparameters);
247255
}
@@ -267,9 +275,12 @@ public function StatMessage($folderid, $id) {
267275
}
268276
else {
269277
$path = $this->_caldav_path . substr($folderid, 1) . "/";
278+
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendCalDAV->StatMessage Data doesn't exist for this item, querying caldav server for uid '%s' in folder '%s'", substr($id, 0, strlen($id)-4), $path));
270279
$e = $this->_caldav->GetEntryByUid(substr($id, 0, strlen($id)-4), $path, $type);
271-
if ($e == null && count($e) <= 0)
280+
if ($e == null && count($e) <= 0) {
281+
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendCalDAV->StatMessage No item on server with uid '%s' in folder '%s'", substr($id, 0, strlen($id)-4), $path));
272282
return;
283+
}
273284
$data = $e[0];
274285
}
275286
$message = array();
@@ -739,7 +750,10 @@ private function _ParseVEventToSyncObject($event, $message, $truncsize) {
739750
case "DESCRIPTION":
740751
if (Request::GetProtocolVersion() >= 12.0) {
741752
$message->asbody = new SyncBaseBody();
753+
754+
// the DESCRIPTION component is specified to be plain text (RFC5545), for HTML use X-ALT-DESC
742755
$data = str_replace("\n","\r\n", str_replace("\r","",Utils::ConvertHtmlToText($property->Value())));
756+
743757
// truncate body, if requested
744758
if (strlen($data) > $truncsize) {
745759
$message->asbody->truncated = 1;
@@ -751,6 +765,9 @@ private function _ParseVEventToSyncObject($event, $message, $truncsize) {
751765
$message->asbody->data = StringStreamWrapper::Open($data);
752766
$message->asbody->estimatedDataSize = strlen($data);
753767
unset($data);
768+
769+
// set body type accordingly
770+
$message->asbody->type = SYNC_BODYPREFERENCE_PLAIN;
754771
$message->nativebodytype = SYNC_BODYPREFERENCE_PLAIN;
755772
}
756773
else {
@@ -1829,4 +1846,4 @@ private static function phpOffsetToIcalOffset($phpoffset) {
18291846
return sprintf("$prefix%'.02d%'.02d", $hours, ($offset - ($hours * 3600)) / 60);
18301847
}
18311848

1832-
}
1849+
};

www/modules/z-push/vendor/z-push/backend/carddav/carddav.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ public function GetGALSearchResults($searchquery, $searchrange, $searchpicture)
797797
// TODO the limiting of the searchresults could be refactored into Utils as it's probably used more than once
798798
$querycnt = $xml_vcards->count();
799799
//do not return more results as requested in range
800-
$querylimit = (($rangeend + 1) < $querycnt) ? ($rangeend + 1) : $querycnt == 0 ? 1 : $querycnt;
800+
$querylimit = (($rangeend + 1) < $querycnt) ? ($rangeend + 1) : ($querycnt == 0 ? 1 : $querycnt);
801801
$items['range'] = $rangestart.'-'.($querylimit - 1);
802802
$items['searchtotal'] = $querycnt;
803803

www/modules/z-push/vendor/z-push/backend/imap/config.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,13 @@
143143
define('IMAP_FROM_SQL_FROM', '#first_name #last_name <#mail_address>');
144144
define('IMAP_FROM_SQL_FULLNAME', '#first_name #last_name');
145145

146-
// SERVER: ldap server
147-
// SERVER_PORT: ldap port
146+
// SERVER_URI: ldap server
148147
// USER: dn to use for connecting
149148
// PASSWORD: password
150149
// QUERY: query to execute
151150
// FIELDS: columns in the query
152151
// FROM: string that will be the from, replacing the field names with the values
153-
define('IMAP_FROM_LDAP_SERVER', 'localhost');
154-
define('IMAP_FROM_LDAP_SERVER_PORT', '389');
152+
define('IMAP_FROM_LDAP_SERVER_URI', 'ldap://127.0.0.1:389/');
155153
define('IMAP_FROM_LDAP_USER', 'cn=zpush,ou=servers,dc=zpush,dc=org');
156154
define('IMAP_FROM_LDAP_PASSWORD', 'password');
157155
define('IMAP_FROM_LDAP_BASE', 'dc=zpush,dc=org');
@@ -216,3 +214,6 @@
216214
// methods and you will be unable to log in. Uncomment the following line to disable that authentication method.
217215
// Multiple methods can be specified as a comma-separated string.
218216
// define('IMAP_DISABLE_AUTHENTICATOR', 'GSSAPI');
217+
218+
// Specify Which Charset the IMAP Search is going to use, Default is 'UTF-8' but you could use 'US-ASCII'
219+
define('IMAP_SEARCH_CHARSET', 'UTF-8');

0 commit comments

Comments
 (0)