1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/z-push_ynh.git synced 2024-09-03 18:05:58 +02:00

Update to latest sources

This commit is contained in:
polytan02 2015-08-22 21:15:55 +01:00
parent 957871fe54
commit 8e8f7c87df
6 changed files with 105 additions and 15 deletions

View file

@ -394,6 +394,19 @@ class BackendCalDAV extends BackendDiff {
return $events;
}
/**
* Resolves recipients
*
* @param SyncObject $resolveRecipients
*
* @access public
* @return SyncObject $resolveRecipients
*/
public function ResolveRecipients($resolveRecipients) {
// TODO:
return false;
}
/**
* Indicates which AS version is supported by the backend.
*

View file

@ -702,6 +702,20 @@ class BackendCardDAV extends BackendDiff implements ISearchProvider {
}
/**
* Resolves recipients
*
* @param SyncObject $resolveRecipients
*
* @access public
* @return SyncObject $resolveRecipients
*/
public function ResolveRecipients($resolveRecipients) {
// TODO:
return false;
}
/**
* Indicates which AS version is supported by the backend.
*

View file

@ -393,6 +393,19 @@ class BackendCombined extends Backend implements ISearchProvider {
return $backend->MeetingResponse($requestid, $this->GetBackendFolder($folderid), $response);
}
/**
* Resolves recipients
*
* @param SyncObject $resolveRecipients
*
* @access public
* @return SyncObject $resolveRecipients
*/
public function ResolveRecipients($resolveRecipients) {
// TODO:
return false;
}
/**
* Deletes all contents of the specified folder.

View file

@ -1730,6 +1730,20 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
}
/**
* Resolves recipients
*
* @param SyncObject $resolveRecipients
*
* @access public
* @return SyncObject $resolveRecipients
*/
public function ResolveRecipients($resolveRecipients) {
// TODO:
return false;
}
/**
* Returns the email address and the display name of the user. Used by autodiscover.
*
@ -1841,7 +1855,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
$search = true;
if (empty($searchFolderId)) {
$searchFolderId = $this->getFolderIdFromImapId('INBOX');
$searchFolderId = $this->getFolderIdFromImapId($this->create_name_folder(IMAP_FOLDER_INBOX), false);
}
// Convert searchFolderId to IMAP id
@ -2049,9 +2063,10 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
* @access protected
* @return string hex folder id
*/
protected function getFolderIdFromImapId($imapid) {
protected function getFolderIdFromImapId($imapid, $case_sensitive = true) {
$this->InitializePermanentStorage();
if ($case_sensitive) {
if (isset($this->permanentStorage->fmFimapFid)) {
if (isset($this->permanentStorage->fmFimapFid[$imapid])) {
$folderid = $this->permanentStorage->fmFimapFid[$imapid];
@ -2063,6 +2078,21 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
return false;
}
}
}
else {
if (isset($this->permanentStorage->fmFimapFidLowercase)) {
if (isset($this->permanentStorage->fmFimapFidLowercase[strtolower($imapid)])) {
$folderid = $this->permanentStorage->fmFimapFidLowercase[strtolower($imapid)];
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s', false) = %s", $imapid, $folderid));
return $folderid;
}
else {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s', false) = %s", $imapid, 'not found'));
return false;
}
}
}
ZLog::Write(LOGLEVEL_WARN, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, 'not initialized!'));
return false;
}
@ -2103,6 +2133,13 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
$b = $this->permanentStorage->fmFimapFid;
$b[$imapid] = $folderid;
$this->permanentStorage->fmFimapFid = $b;
if (!isset($this->permanentStorage->fmFimapFidLowercase))
$this->permanentStorage->fmFimapFidLowercase = array();
$c = $this->permanentStorage->fmFimapFidLowercase;
$c[strtolower($imapid)] = $folderid;
$this->permanentStorage->fmFimapFidLowercase = $c;
}
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->convertImapId('%s') = %s", $imapid, $folderid));
@ -2328,7 +2365,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
*/
protected function checkIfIMAPFolder($folderName) {
$folder_name = $folderName;
if (defined(IMAP_FOLDER_PREFIX) && strlen(IMAP_FOLDER_PREFIX) > 0) {
if (defined('IMAP_FOLDER_PREFIX') && strlen(IMAP_FOLDER_PREFIX) > 0) {
// TODO: We don't care about the inbox exception with the prefix, because we won't check inbox
$folder_name = IMAP_FOLDER_PREFIX . $this->getServerDelimiter() . $folder_name;
}
@ -2470,7 +2507,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
}
if ($this->sentID === false) {
$this->sentID = $this->getFolderIdFromImapId($this->create_name_folder(IMAP_FOLDER_SENT));
$this->sentID = $this->getFolderIdFromImapId($this->create_name_folder(IMAP_FOLDER_SENT), false);
}
$saved = false;

View file

@ -9,8 +9,8 @@
* Created : 07.04.2012
*
* Copyright 2012 - 2014 Jean-Louis Dupond
*
* Jean-Louis Dupond released this code as AGPLv3 here: https://github.com/dupondje/PHP-Push-2/issues/93
* Copyright 2015 - Francisco Miguel Biete
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
@ -565,6 +565,19 @@ class BackendLDAP extends BackendDiff {
return false;
}
/**
* Resolves recipients
*
* @param SyncObject $resolveRecipients
*
* @access public
* @return SyncObject $resolveRecipients
*/
public function ResolveRecipients($resolveRecipients) {
// TODO:
return false;
}
/**
* Indicates which AS version is supported by the backend.
*

View file

@ -89,7 +89,7 @@ if (defined('LOG_MEMORY_PROFILER') && LOG_MEMORY_PROFILER) {
// Stop here if this is an OPTIONS request
if (Request::IsMethodOPTIONS()) {
if (!$autenticationInfo || !$GETUser) {
throw new AuthenticationRequiredException("Access denied. Please send authorisation information");
throw new AuthenticationRequiredException("Access denied. Please send authentication information");
}
else {
throw new NoPostRequestException("Options request", NoPostRequestException::OPTIONS_REQUEST);