Commit 804d9207 authored by Sebastian Kummer's avatar Sebastian Kummer

Merging in latest from upstream (ZP/z-push:refs/heads/develop)

* commit '9995418d':
  ZP-861 Move comment.
  ZP-861 User with umlauts in user name is not able to login.
  ZP-844 Fix warnings when PR_EC_OUTOFOFFICE_FROM and PR_EC_OUTOFOFFICE_UNTIL are not set. Rename settingsOOFSEt to settingsOofSet and settingsOOFGEt to settingsOofGet.
parents c2e761f1 9995418d
...@@ -418,8 +418,6 @@ class MAPIUtils { ...@@ -418,8 +418,6 @@ class MAPIUtils {
if (isset($supportmask[PR_STORE_SUPPORT_MASK]) && ($supportmask[PR_STORE_SUPPORT_MASK] & STORE_UNICODE_OK)) { if (isset($supportmask[PR_STORE_SUPPORT_MASK]) && ($supportmask[PR_STORE_SUPPORT_MASK] & STORE_UNICODE_OK)) {
ZLog::Write(LOGLEVEL_DEBUG, "Store supports properties containing Unicode characters."); ZLog::Write(LOGLEVEL_DEBUG, "Store supports properties containing Unicode characters.");
define('STORE_SUPPORTS_UNICODE', true); define('STORE_SUPPORTS_UNICODE', true);
//setlocale to UTF-8 in order to support properties containing Unicode characters
setlocale(LC_CTYPE, "en_US.UTF-8");
define('STORE_INTERNET_CPID', INTERNET_CPID_UTF8); define('STORE_INTERNET_CPID', INTERNET_CPID_UTF8);
} }
} }
......
...@@ -74,6 +74,8 @@ include_once('backend/zarafa/mapistreamwrapper.php'); ...@@ -74,6 +74,8 @@ include_once('backend/zarafa/mapistreamwrapper.php');
include_once('backend/zarafa/importer.php'); include_once('backend/zarafa/importer.php');
include_once('backend/zarafa/exporter.php'); include_once('backend/zarafa/exporter.php');
//setlocale to UTF-8 in order to support properties containing Unicode characters
setlocale(LC_CTYPE, "en_US.UTF-8");
class BackendZarafa implements IBackend, ISearchProvider { class BackendZarafa implements IBackend, ISearchProvider {
private $mainUser; private $mainUser;
...@@ -1561,10 +1563,10 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -1561,10 +1563,10 @@ class BackendZarafa implements IBackend, ISearchProvider {
private function settingsOOF(&$oof) { private function settingsOOF(&$oof) {
//if oof state is set it must be set of oof and get otherwise //if oof state is set it must be set of oof and get otherwise
if (isset($oof->oofstate)) { if (isset($oof->oofstate)) {
$this->settingsOOFSEt($oof); $this->settingsOofSet($oof);
} }
else { else {
$this->settingsOOFGEt($oof); $this->settingsOofGet($oof);
} }
} }
...@@ -1576,7 +1578,7 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -1576,7 +1578,7 @@ class BackendZarafa implements IBackend, ISearchProvider {
* @access private * @access private
* @return void * @return void
*/ */
private function settingsOOFGEt(&$oof) { private function settingsOofGet(&$oof) {
$oofprops = mapi_getprops($this->defaultstore, array(PR_EC_OUTOFOFFICE, PR_EC_OUTOFOFFICE_MSG, PR_EC_OUTOFOFFICE_SUBJECT, PR_EC_OUTOFOFFICE_FROM, PR_EC_OUTOFOFFICE_UNTIL)); $oofprops = mapi_getprops($this->defaultstore, array(PR_EC_OUTOFOFFICE, PR_EC_OUTOFOFFICE_MSG, PR_EC_OUTOFOFFICE_SUBJECT, PR_EC_OUTOFOFFICE_FROM, PR_EC_OUTOFOFFICE_UNTIL));
$oof->oofstate = SYNC_SETTINGSOOF_DISABLED; $oof->oofstate = SYNC_SETTINGSOOF_DISABLED;
$oof->Status = SYNC_SETTINGSSTATUS_SUCCESS; $oof->Status = SYNC_SETTINGSSTATUS_SUCCESS;
...@@ -1592,19 +1594,24 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -1592,19 +1594,24 @@ class BackendZarafa implements IBackend, ISearchProvider {
$oof->oofmessage[] = $oofmessage; $oof->oofmessage[] = $oofmessage;
// check whether time based out of office is set // check whether time based out of office is set
if ($oof->oofstate == SYNC_SETTINGSOOF_GLOBAL) { if ($oof->oofstate == SYNC_SETTINGSOOF_GLOBAL && isset($oofprops[PR_EC_OUTOFOFFICE_FROM]) && isset($oofprops[PR_EC_OUTOFOFFICE_UNTIL])) {
if (isset($oofprops[PR_EC_OUTOFOFFICE_FROM]) && isset($oofprops[PR_EC_OUTOFOFFICE_UNTIL]) && ($oofprops[PR_EC_OUTOFOFFICE_FROM] < $oofprops[PR_EC_OUTOFOFFICE_UNTIL]) ) { if ($oofprops[PR_EC_OUTOFOFFICE_FROM] < $oofprops[PR_EC_OUTOFOFFICE_UNTIL]) {
$oof->oofstate = SYNC_SETTINGSOOF_TIMEBASED; $oof->oofstate = SYNC_SETTINGSOOF_TIMEBASED;
$oof->starttime = $oofprops[PR_EC_OUTOFOFFICE_FROM]; $oof->starttime = $oofprops[PR_EC_OUTOFOFFICE_FROM];
$oof->endtime = $oofprops[PR_EC_OUTOFOFFICE_UNTIL]; $oof->endtime = $oofprops[PR_EC_OUTOFOFFICE_UNTIL];
} }
elseif (isset($oofprops[PR_EC_OUTOFOFFICE_FROM]) || isset($oofprops[PR_EC_OUTOFOFFICE_UNTIL]) || ($oofprops[PR_EC_OUTOFOFFICE_FROM] > $oofprops[PR_EC_OUTOFOFFICE_UNTIL])) { else {
ZLog::Write(LOGLEVEL_WARN, sprintf("Zarafa->settingsOOFGEt(): Time based out of office set but either start time ('%s') or end time ('%s') is missing or end time is before startime.", ZLog::Write(LOGLEVEL_WARN, sprintf("Zarafa->settingsOofGet(): Time based out of office set but end time ('%s') is before startime ('%s').",
(isset($oofprops[PR_EC_OUTOFOFFICE_FROM]) ? date("Y-m-d H:i:s", $oofprops[PR_EC_OUTOFOFFICE_FROM]) : 'empty'), date("Y-m-d H:i:s", $oofprops[PR_EC_OUTOFOFFICE_FROM]), date("Y-m-d H:i:s", $oofprops[PR_EC_OUTOFOFFICE_UNTIL])));
(isset($oofprops[PR_EC_OUTOFOFFICE_UNTIL]) ? date("Y-m-d H:i:s", $oofprops[PR_EC_OUTOFOFFICE_UNTIL]) : 'empty')));
$oof->Status = SYNC_SETTINGSSTATUS_PROTOCOLLERROR; $oof->Status = SYNC_SETTINGSSTATUS_PROTOCOLLERROR;
} }
} }
elseif ($oof->oofstate == SYNC_SETTINGSOOF_GLOBAL && (isset($oofprops[PR_EC_OUTOFOFFICE_FROM]) || isset($oofprops[PR_EC_OUTOFOFFICE_UNTIL]))) {
ZLog::Write(LOGLEVEL_WARN, sprintf("Zarafa->settingsOofGet(): Time based out of office set but either start time ('%s') or end time ('%s') is missing.",
(isset($oofprops[PR_EC_OUTOFOFFICE_FROM]) ? date("Y-m-d H:i:s", $oofprops[PR_EC_OUTOFOFFICE_FROM]) : 'empty'),
(isset($oofprops[PR_EC_OUTOFOFFICE_UNTIL]) ? date("Y-m-d H:i:s", $oofprops[PR_EC_OUTOFOFFICE_UNTIL]) : 'empty')));
$oof->Status = SYNC_SETTINGSSTATUS_PROTOCOLLERROR;
}
} }
else { else {
ZLog::Write(LOGLEVEL_WARN, "Unable to get out of office information"); ZLog::Write(LOGLEVEL_WARN, "Unable to get out of office information");
...@@ -1622,7 +1629,7 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -1622,7 +1629,7 @@ class BackendZarafa implements IBackend, ISearchProvider {
* @access private * @access private
* @return void * @return void
*/ */
private function settingsOOFSEt(&$oof) { private function settingsOofSet(&$oof) {
$oof->Status = SYNC_SETTINGSSTATUS_SUCCESS; $oof->Status = SYNC_SETTINGSSTATUS_SUCCESS;
$props = array(); $props = array();
if ($oof->oofstate == SYNC_SETTINGSOOF_GLOBAL || $oof->oofstate == SYNC_SETTINGSOOF_TIMEBASED) { if ($oof->oofstate == SYNC_SETTINGSOOF_GLOBAL || $oof->oofstate == SYNC_SETTINGSOOF_TIMEBASED) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment