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:
parent
957871fe54
commit
8e8f7c87df
6 changed files with 105 additions and 15 deletions
|
@ -394,6 +394,19 @@ class BackendCalDAV extends BackendDiff {
|
||||||
return $events;
|
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.
|
* Indicates which AS version is supported by the backend.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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.
|
* Indicates which AS version is supported by the backend.
|
||||||
*
|
*
|
||||||
|
|
|
@ -393,6 +393,19 @@ class BackendCombined extends Backend implements ISearchProvider {
|
||||||
return $backend->MeetingResponse($requestid, $this->GetBackendFolder($folderid), $response);
|
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.
|
* Deletes all contents of the specified folder.
|
||||||
|
|
|
@ -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.
|
* 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;
|
$search = true;
|
||||||
|
|
||||||
if (empty($searchFolderId)) {
|
if (empty($searchFolderId)) {
|
||||||
$searchFolderId = $this->getFolderIdFromImapId('INBOX');
|
$searchFolderId = $this->getFolderIdFromImapId($this->create_name_folder(IMAP_FOLDER_INBOX), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert searchFolderId to IMAP id
|
// Convert searchFolderId to IMAP id
|
||||||
|
@ -2049,20 +2063,36 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return string hex folder id
|
* @return string hex folder id
|
||||||
*/
|
*/
|
||||||
protected function getFolderIdFromImapId($imapid) {
|
protected function getFolderIdFromImapId($imapid, $case_sensitive = true) {
|
||||||
$this->InitializePermanentStorage();
|
$this->InitializePermanentStorage();
|
||||||
|
|
||||||
if (isset($this->permanentStorage->fmFimapFid)) {
|
if ($case_sensitive) {
|
||||||
if (isset($this->permanentStorage->fmFimapFid[$imapid])) {
|
if (isset($this->permanentStorage->fmFimapFid)) {
|
||||||
$folderid = $this->permanentStorage->fmFimapFid[$imapid];
|
if (isset($this->permanentStorage->fmFimapFid[$imapid])) {
|
||||||
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, $folderid));
|
$folderid = $this->permanentStorage->fmFimapFid[$imapid];
|
||||||
return $folderid;
|
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, $folderid));
|
||||||
}
|
return $folderid;
|
||||||
else {
|
}
|
||||||
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, 'not found'));
|
else {
|
||||||
return false;
|
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, 'not found'));
|
||||||
|
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!'));
|
ZLog::Write(LOGLEVEL_WARN, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, 'not initialized!'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2103,6 +2133,13 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
|
||||||
$b = $this->permanentStorage->fmFimapFid;
|
$b = $this->permanentStorage->fmFimapFid;
|
||||||
$b[$imapid] = $folderid;
|
$b[$imapid] = $folderid;
|
||||||
$this->permanentStorage->fmFimapFid = $b;
|
$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));
|
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) {
|
protected function checkIfIMAPFolder($folderName) {
|
||||||
$folder_name = $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
|
// 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;
|
$folder_name = IMAP_FOLDER_PREFIX . $this->getServerDelimiter() . $folder_name;
|
||||||
}
|
}
|
||||||
|
@ -2470,7 +2507,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->sentID === false) {
|
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;
|
$saved = false;
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
* Created : 07.04.2012
|
* Created : 07.04.2012
|
||||||
*
|
*
|
||||||
* Copyright 2012 - 2014 Jean-Louis Dupond
|
* Copyright 2012 - 2014 Jean-Louis Dupond
|
||||||
*
|
|
||||||
* Jean-Louis Dupond released this code as AGPLv3 here: https://github.com/dupondje/PHP-Push-2/issues/93
|
* 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
|
* 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,
|
* it under the terms of the GNU Affero General Public License, version 3,
|
||||||
|
@ -565,6 +565,19 @@ class BackendLDAP extends BackendDiff {
|
||||||
return false;
|
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.
|
* Indicates which AS version is supported by the backend.
|
||||||
*
|
*
|
||||||
|
|
|
@ -89,7 +89,7 @@ if (defined('LOG_MEMORY_PROFILER') && LOG_MEMORY_PROFILER) {
|
||||||
// Stop here if this is an OPTIONS request
|
// Stop here if this is an OPTIONS request
|
||||||
if (Request::IsMethodOPTIONS()) {
|
if (Request::IsMethodOPTIONS()) {
|
||||||
if (!$autenticationInfo || !$GETUser) {
|
if (!$autenticationInfo || !$GETUser) {
|
||||||
throw new AuthenticationRequiredException("Access denied. Please send authorisation information");
|
throw new AuthenticationRequiredException("Access denied. Please send authentication information");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new NoPostRequestException("Options request", NoPostRequestException::OPTIONS_REQUEST);
|
throw new NoPostRequestException("Options request", NoPostRequestException::OPTIONS_REQUEST);
|
||||||
|
|
Loading…
Add table
Reference in a new issue