@@ -10,7 +10,7 @@ |
||
| 10 | 10 | $branch = trim(exec("hash git 2>/dev/null && cd {$path} >/dev/null 2>&1 && git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e \"s/* \\(.*\\)/\\1/\"")); |
| 11 | 11 | $version = exec("hash git 2>/dev/null && cd {$path} >/dev/null 2>&1 && git describe --always 2>/dev/null"); |
| 12 | 12 | if ($branch && $version) { |
| 13 | - define('GROMMUNIOSYNC_VERSION', $branch . '-' . $version); |
|
| 13 | + define('GROMMUNIOSYNC_VERSION', $branch.'-'.$version); |
|
| 14 | 14 | } else { |
| 15 | 15 | define('GROMMUNIOSYNC_VERSION', 'GIT'); |
| 16 | 16 | } |
@@ -29,20 +29,20 @@ discard block |
||
| 29 | 29 | * @return string |
| 30 | 30 | */ |
| 31 | 31 | public function BuildLogString($loglevel, $message, $includeUserDevice = true) { |
| 32 | - $log = Utils::GetFormattedTime() . ' [' . str_pad($this->GetPid(), 5, ' ', STR_PAD_LEFT) . '] ' . $this->GetLogLevelString($loglevel, $loglevel >= LOGLEVEL_INFO); |
|
| 32 | + $log = Utils::GetFormattedTime().' ['.str_pad($this->GetPid(), 5, ' ', STR_PAD_LEFT).'] '.$this->GetLogLevelString($loglevel, $loglevel >= LOGLEVEL_INFO); |
|
| 33 | 33 | |
| 34 | 34 | if ($includeUserDevice) { |
| 35 | 35 | // when the users differ, we need to log both |
| 36 | 36 | if (0 == strcasecmp($this->GetAuthUser(), $this->GetUser())) { |
| 37 | - $log .= ' [' . $this->GetUser() . ']'; |
|
| 37 | + $log .= ' ['.$this->GetUser().']'; |
|
| 38 | 38 | } else { |
| 39 | - $log .= ' [' . $this->GetAuthUser() . Request::IMPERSONATE_DELIM . $this->GetUser() . ']'; |
|
| 39 | + $log .= ' ['.$this->GetAuthUser().Request::IMPERSONATE_DELIM.$this->GetUser().']'; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | if ($includeUserDevice && (LOGLEVEL >= LOGLEVEL_DEVICEID || (LOGUSERLEVEL >= LOGLEVEL_DEVICEID && $this->IsAuthUserInSpecialLogUsers()))) { |
| 43 | - $log .= ' [' . $this->GetDevid() . ']'; |
|
| 43 | + $log .= ' ['.$this->GetDevid().']'; |
|
| 44 | 44 | } |
| 45 | - $log .= ' ' . $message; |
|
| 45 | + $log .= ' '.$message; |
|
| 46 | 46 | |
| 47 | 47 | return $log; |
| 48 | 48 | } |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | * @param string $message |
| 55 | 55 | */ |
| 56 | 56 | public function WriteForUser($loglevel, $message) { |
| 57 | - $data = $this->BuildLogString($loglevel, $message, false) . PHP_EOL; |
|
| 58 | - @file_put_contents(LOGFILEDIR . $this->getLogToUserFile(), $data, FILE_APPEND); |
|
| 57 | + $data = $this->BuildLogString($loglevel, $message, false).PHP_EOL; |
|
| 58 | + @file_put_contents(LOGFILEDIR.$this->getLogToUserFile(), $data, FILE_APPEND); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * @param string $message |
| 70 | 70 | */ |
| 71 | 71 | protected function Write($loglevel, $message) { |
| 72 | - $data = $this->BuildLogString($loglevel, $message) . PHP_EOL; |
|
| 72 | + $data = $this->BuildLogString($loglevel, $message).PHP_EOL; |
|
| 73 | 73 | @file_put_contents(LOGFILE, $data, FILE_APPEND); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | * @param mixed $message |
| 82 | 82 | */ |
| 83 | 83 | protected function afterLog($loglevel, $message) { |
| 84 | - if ($loglevel & (LOGLEVEL_FATAL | LOGLEVEL_ERROR | LOGLEVEL_WARN)) { |
|
| 85 | - $data = $this->BuildLogString($loglevel, $message) . PHP_EOL; |
|
| 84 | + if ($loglevel & (LOGLEVEL_FATAL|LOGLEVEL_ERROR|LOGLEVEL_WARN)) { |
|
| 85 | + $data = $this->BuildLogString($loglevel, $message).PHP_EOL; |
|
| 86 | 86 | @file_put_contents(LOGERRORFILE, $data, FILE_APPEND); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | private function getLogToUserFile() { |
| 96 | 96 | if (false === $this->log_to_user_file) { |
| 97 | 97 | if (in_array(strtolower($this->GetDevid()), ['', 'validate'])) { |
| 98 | - $this->setLogToUserFile(preg_replace('/[^a-z0-9]/', '_', strtolower($this->GetAuthUser())) . '.log'); |
|
| 98 | + $this->setLogToUserFile(preg_replace('/[^a-z0-9]/', '_', strtolower($this->GetAuthUser())).'.log'); |
|
| 99 | 99 | } else { |
| 100 | 100 | $this->setLogToUserFile( |
| 101 | - preg_replace('/[^a-z0-9]/', '_', strtolower($this->GetAuthUser())) . '-' . |
|
| 102 | - (($this->GetAuthUser() != $this->GetUser()) ? preg_replace('/[^a-z0-9]/', '_', strtolower($this->GetUser())) . '-' : '') . |
|
| 103 | - preg_replace('/[^a-z0-9]/', '_', strtolower($this->GetDevid())) . |
|
| 101 | + preg_replace('/[^a-z0-9]/', '_', strtolower($this->GetAuthUser())).'-'. |
|
| 102 | + (($this->GetAuthUser() != $this->GetUser()) ? preg_replace('/[^a-z0-9]/', '_', strtolower($this->GetUser())).'-' : ''). |
|
| 103 | + preg_replace('/[^a-z0-9]/', '_', strtolower($this->GetDevid())). |
|
| 104 | 104 | '.log' |
| 105 | 105 | ); |
| 106 | 106 | } |
@@ -294,11 +294,11 @@ |
||
| 294 | 294 | |
| 295 | 295 | break; |
| 296 | 296 | |
| 297 | - case LOGLEVEL_WARN: return '[' . $s . 'WARN]'; |
|
| 297 | + case LOGLEVEL_WARN: return '['.$s.'WARN]'; |
|
| 298 | 298 | |
| 299 | 299 | break; |
| 300 | 300 | |
| 301 | - case LOGLEVEL_INFO: return '[' . $s . 'INFO]'; |
|
| 301 | + case LOGLEVEL_INFO: return '['.$s.'INFO]'; |
|
| 302 | 302 | |
| 303 | 303 | break; |
| 304 | 304 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function SetPort($value) { |
| 82 | 82 | if (is_numeric($value)) { |
| 83 | - $this->port = (int) $value; |
|
| 83 | + $this->port = (int)$value; |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | $log = $this->GetLogLevelString($loglevel); // Never pad syslog log because syslog log are usually read with a software. |
| 98 | 98 | // when the users differ, we need to log both |
| 99 | 99 | if (0 == strcasecmp($this->GetAuthUser(), $this->GetUser())) { |
| 100 | - $log .= ' [' . $this->GetUser() . ']'; |
|
| 100 | + $log .= ' ['.$this->GetUser().']'; |
|
| 101 | 101 | } else { |
| 102 | - $log .= ' [' . $this->GetAuthUser() . Request::IMPERSONATE_DELIM . $this->GetUser() . ']'; |
|
| 102 | + $log .= ' ['.$this->GetAuthUser().Request::IMPERSONATE_DELIM.$this->GetUser().']'; |
|
| 103 | 103 | } |
| 104 | 104 | if ($loglevel >= LOGLEVEL_DEVICEID) { |
| 105 | - $log .= '[' . $this->GetDevid() . ']'; |
|
| 105 | + $log .= '['.$this->GetDevid().']'; |
|
| 106 | 106 | } |
| 107 | - $log .= ' ' . $message; |
|
| 107 | + $log .= ' '.$message; |
|
| 108 | 108 | |
| 109 | 109 | return $log; |
| 110 | 110 | } |
@@ -135,17 +135,17 @@ discard block |
||
| 135 | 135 | if (!isset($trace['file'])) { |
| 136 | 136 | continue; |
| 137 | 137 | } |
| 138 | - if (false !== strpos($trace['file'], REAL_BASE_PATH . 'backend/')) { |
|
| 138 | + if (false !== strpos($trace['file'], REAL_BASE_PATH.'backend/')) { |
|
| 139 | 139 | preg_match('/\/backend\/([a-zA-Z]*)/', $trace['file'], $match); |
| 140 | 140 | if (isset($match[1])) { |
| 141 | - return $this->GetProgramName() . '/' . $match[1]; |
|
| 141 | + return $this->GetProgramName().'/'.$match[1]; |
|
| 142 | 142 | } |
| 143 | 143 | } elseif ('slog' != basename($trace['file'], '.php')) { |
| 144 | - return $this->GetProgramName() . '/core'; |
|
| 144 | + return $this->GetProgramName().'/core'; |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - return $this->GetProgramName() . '/core'; |
|
| 148 | + return $this->GetProgramName().'/core'; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $pri = ($facility * 8) + $loglevel; // multiplying the Facility number by 8 + adding the level |
| 211 | 211 | $data = $this->BuildLogString($loglevel, $message); |
| 212 | 212 | if (strlen(trim($data)) > 0) { |
| 213 | - $syslog_message = "<{$pri}>" . date('M d H:i:s ') . '[' . $this->GetProgramName() . ']: ' . $data; |
|
| 213 | + $syslog_message = "<{$pri}>".date('M d H:i:s ').'['.$this->GetProgramName().']: '.$data; |
|
| 214 | 214 | socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $this->GetHost(), $this->GetPort()); |
| 215 | 215 | } |
| 216 | 216 | socket_close($sock); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | // change exporterflags if we are doing a ContentExport |
| 104 | 104 | if ($this->folderid) { |
| 105 | - $this->exporterflags |= SYNC_NORMAL | SYNC_READ_STATE; |
|
| 105 | + $this->exporterflags |= SYNC_NORMAL|SYNC_READ_STATE; |
|
| 106 | 106 | |
| 107 | 107 | // Initial sync, we don't want deleted items. If the initial sync is chunked |
| 108 | 108 | // we check the change ID of the syncstate (0 at initial sync) |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | if (!($this->flags & BACKEND_DISCARD_DATA)) { |
| 112 | 112 | SLog::Write(LOGLEVEL_DEBUG, 'ExportChangesICS->Config(): syncing initial data'); |
| 113 | 113 | } |
| 114 | - $this->exporterflags |= SYNC_NO_SOFT_DELETIONS | SYNC_NO_DELETIONS; |
|
| 114 | + $this->exporterflags |= SYNC_NO_SOFT_DELETIONS|SYNC_NO_DELETIONS; |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | if (function_exists('mapi_feature') && mapi_feature('LOGONFLAGS')) { |
| 239 | 239 | // send grommunio-sync version and user agent to ZCP - ZP-589 |
| 240 | 240 | if (Utils::CheckMapiExtVersion('7.2.0')) { |
| 241 | - $gsync_version = 'Grommunio-Sync_' . @constant('GROMMUNIOSYNC_VERSION'); |
|
| 241 | + $gsync_version = 'Grommunio-Sync_'.@constant('GROMMUNIOSYNC_VERSION'); |
|
| 242 | 242 | $user_agent = ($deviceId) ? GSync::GetDeviceManager()->GetUserAgent() : 'unknown'; |
| 243 | 243 | $this->session = @mapi_logon_zarafa($this->mainUser, $pass, MAPI_SERVER, null, null, 0, $gsync_version, $user_agent); |
| 244 | 244 | } else { |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $this->store = $this->defaultstore; |
| 290 | 290 | $this->storeName = $defaultUser; |
| 291 | 291 | |
| 292 | - SLog::Write(LOGLEVEL_DEBUG, sprintf("Grommunio->Logon(): User '%s' is authenticated%s", $this->mainUser, ($this->impersonateUser ? " impersonating '" . $this->impersonateUser . "'" : ''))); |
|
| 292 | + SLog::Write(LOGLEVEL_DEBUG, sprintf("Grommunio->Logon(): User '%s' is authenticated%s", $this->mainUser, ($this->impersonateUser ? " impersonating '".$this->impersonateUser."'" : ''))); |
|
| 293 | 293 | |
| 294 | 294 | $this->isGSyncEnabled(); |
| 295 | 295 | |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $fwbody = w2u($fwbody); |
| 581 | 581 | } |
| 582 | 582 | |
| 583 | - $mapiprops[$sendMailProps['body']] = $body . "\r\n\r\n" . $fwbody; |
|
| 583 | + $mapiprops[$sendMailProps['body']] = $body."\r\n\r\n".$fwbody; |
|
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | if (strlen($bodyHtml) > 0) { |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | $fwbodyHtml = w2u($fwbodyHtml); |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | - $mapiprops[$sendMailProps['html']] = $bodyHtml . '<br><br>' . $fwbodyHtml; |
|
| 599 | + $mapiprops[$sendMailProps['html']] = $bodyHtml.'<br><br>'.$fwbodyHtml; |
|
| 600 | 600 | } |
| 601 | 601 | } |
| 602 | 602 | } else { |
@@ -959,11 +959,11 @@ discard block |
||
| 959 | 959 | if ($calFolderId) { |
| 960 | 960 | $shortFolderId = GSync::GetDeviceManager()->GetFolderIdForBackendId($calFolderId); |
| 961 | 961 | if ($calFolderId != $shortFolderId) { |
| 962 | - $prefix = $shortFolderId . ':'; |
|
| 962 | + $prefix = $shortFolderId.':'; |
|
| 963 | 963 | } |
| 964 | 964 | } |
| 965 | 965 | |
| 966 | - return $prefix . $calendarid; |
|
| 966 | + return $prefix.$calendarid; |
|
| 967 | 967 | } |
| 968 | 968 | |
| 969 | 969 | /** |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | } |
| 1311 | 1311 | } |
| 1312 | 1312 | $nrResults = count($items); |
| 1313 | - $items['range'] = ($nrResults > 0) ? $rangestart . '-' . ($nrResults - 1) : '0-0'; |
|
| 1313 | + $items['range'] = ($nrResults > 0) ? $rangestart.'-'.($nrResults - 1) : '0-0'; |
|
| 1314 | 1314 | $items['searchtotal'] = $nrResults; |
| 1315 | 1315 | |
| 1316 | 1316 | return $items; |
@@ -1361,8 +1361,7 @@ discard block |
||
| 1361 | 1361 | |
| 1362 | 1362 | // if the search range is set limit the result to it, otherwise return all found messages |
| 1363 | 1363 | $rows = (is_array($searchRange) && isset($searchRange[0], $searchRange[1])) ? |
| 1364 | - mapi_table_queryrows($table, [PR_ENTRYID], $searchRange[0], $searchRange[1] - $searchRange[0] + 1) : |
|
| 1365 | - mapi_table_queryrows($table, [PR_ENTRYID], 0, SEARCH_MAXRESULTS); |
|
| 1364 | + mapi_table_queryrows($table, [PR_ENTRYID], $searchRange[0], $searchRange[1] - $searchRange[0] + 1) : mapi_table_queryrows($table, [PR_ENTRYID], 0, SEARCH_MAXRESULTS); |
|
| 1366 | 1365 | |
| 1367 | 1366 | $cnt = count($rows); |
| 1368 | 1367 | $items['searchtotal'] = $cnt; |
@@ -1412,7 +1411,7 @@ discard block |
||
| 1412 | 1411 | [ |
| 1413 | 1412 | FUZZYLEVEL => FL_PREFIX, |
| 1414 | 1413 | ULPROPTAG => PR_DISPLAY_NAME, |
| 1415 | - VALUE => [PR_DISPLAY_NAME => 'grommunio-sync Search Folder ' . $pid], |
|
| 1414 | + VALUE => [PR_DISPLAY_NAME => 'grommunio-sync Search Folder '.$pid], |
|
| 1416 | 1415 | ], |
| 1417 | 1416 | ], |
| 1418 | 1417 | TBL_BATCH |
@@ -1556,7 +1555,7 @@ discard block |
||
| 1556 | 1555 | $content_unread = isset($folder[PR_CONTENT_UNREAD]) ? $folder[PR_CONTENT_UNREAD] : -1; |
| 1557 | 1556 | $content_deleted = isset($folder[PR_DELETED_MSG_COUNT]) ? $folder[PR_DELETED_MSG_COUNT] : -1; |
| 1558 | 1557 | |
| 1559 | - $this->folderStatCache[$user][bin2hex($folder[PR_SOURCE_KEY])] = $commit_time . '/' . $content_count . '/' . $content_unread . '/' . $content_deleted; |
|
| 1558 | + $this->folderStatCache[$user][bin2hex($folder[PR_SOURCE_KEY])] = $commit_time.'/'.$content_count.'/'.$content_unread.'/'.$content_deleted; |
|
| 1560 | 1559 | } |
| 1561 | 1560 | SLog::Write(LOGLEVEL_DEBUG, sprintf("Grommunio->GetFolderStat() fetched status information of %d folders for store '%s'", count($this->folderStatCache[$user]), $user)); |
| 1562 | 1561 | } |
@@ -1730,7 +1729,7 @@ discard block |
||
| 1730 | 1729 | )); |
| 1731 | 1730 | } |
| 1732 | 1731 | } |
| 1733 | - $messageName = rtrim(((false !== $key) ? $key . '-' : '') . (('' !== $type) ? $type : ''), '-'); |
|
| 1732 | + $messageName = rtrim(((false !== $key) ? $key.'-' : '').(('' !== $type) ? $type : ''), '-'); |
|
| 1734 | 1733 | $restriction = $this->getStateMessageRestriction($messageName, $counter, $thisCounterOnly); |
| 1735 | 1734 | $stateFolderContents = mapi_folder_getcontentstable($this->stateFolder, MAPI_ASSOCIATED); |
| 1736 | 1735 | if ($stateFolderContents) { |
@@ -1943,7 +1942,7 @@ discard block |
||
| 1943 | 1942 | )); |
| 1944 | 1943 | } |
| 1945 | 1944 | } |
| 1946 | - $messageName = rtrim(((false !== $key) ? $key . '-' : '') . (('' !== $type) ? $type : ''), '-'); |
|
| 1945 | + $messageName = rtrim(((false !== $key) ? $key.'-' : '').(('' !== $type) ? $type : ''), '-'); |
|
| 1947 | 1946 | $restriction = $this->getStateMessageRestriction($messageName, $counter, true); |
| 1948 | 1947 | $stateFolderContents = mapi_folder_getcontentstable($this->stateFolder, MAPI_ASSOCIATED); |
| 1949 | 1948 | if ($stateFolderContents) { |
@@ -1991,17 +1990,17 @@ discard block |
||
| 1991 | 1990 | $stateMessage = mapi_folder_createmessage($this->stateFolder, MAPI_ASSOCIATED); |
| 1992 | 1991 | SLog::Write(LOGLEVEL_DEBUG, sprintf('Grommunio->setStateMessage(): mapi_folder_createmessage 0x%08X', mapi_last_hresult())); |
| 1993 | 1992 | |
| 1994 | - $messageName = rtrim(((false !== $key) ? $key . '-' : '') . (('' !== $type) ? $type : ''), '-'); |
|
| 1993 | + $messageName = rtrim(((false !== $key) ? $key.'-' : '').(('' !== $type) ? $type : ''), '-'); |
|
| 1995 | 1994 | SLog::Write(LOGLEVEL_DEBUG, sprintf("Grommunio->setStateMessage(): creating new state message '%s-%d'", $messageName, is_int($counter) ? $counter : 0)); |
| 1996 | 1995 | mapi_setprops($stateMessage, [PR_DISPLAY_NAME => $messageName, PR_MESSAGE_CLASS => 'IPM.Note.GrommunioState']); |
| 1997 | 1996 | } |
| 1998 | 1997 | if (isset($stateMessage)) { |
| 1999 | - $jsonEncodedState = is_object($state) || is_array($state) ? json_encode($state, JSON_INVALID_UTF8_IGNORE | JSON_UNESCAPED_UNICODE) : $state; |
|
| 1998 | + $jsonEncodedState = is_object($state) || is_array($state) ? json_encode($state, JSON_INVALID_UTF8_IGNORE|JSON_UNESCAPED_UNICODE) : $state; |
|
| 2000 | 1999 | |
| 2001 | 2000 | $encodedState = base64_encode($jsonEncodedState); |
| 2002 | 2001 | $encodedStateLength = strlen($encodedState); |
| 2003 | 2002 | mapi_setprops($stateMessage, [PR_LAST_VERB_EXECUTED => is_int($counter) ? $counter : 0]); |
| 2004 | - $stream = mapi_openproperty($stateMessage, PR_BODY, IID_IStream, STGM_DIRECT, MAPI_CREATE | MAPI_MODIFY); |
|
| 2003 | + $stream = mapi_openproperty($stateMessage, PR_BODY, IID_IStream, STGM_DIRECT, MAPI_CREATE|MAPI_MODIFY); |
|
| 2005 | 2004 | mapi_stream_setsize($stream, $encodedStateLength); |
| 2006 | 2005 | mapi_stream_write($stream, $encodedState); |
| 2007 | 2006 | mapi_stream_commit($stream); |
@@ -2096,7 +2095,7 @@ discard block |
||
| 2096 | 2095 | private function adviseStoreToSink($store) { |
| 2097 | 2096 | // check if we already advised the store |
| 2098 | 2097 | if (!in_array($store, $this->changesSinkStores)) { |
| 2099 | - mapi_msgstore_advise($store, null, fnevObjectModified | fnevObjectCreated | fnevObjectMoved | fnevObjectDeleted, $this->changesSink); |
|
| 2098 | + mapi_msgstore_advise($store, null, fnevObjectModified|fnevObjectCreated|fnevObjectMoved|fnevObjectDeleted, $this->changesSink); |
|
| 2100 | 2099 | |
| 2101 | 2100 | if (mapi_last_hresult()) { |
| 2102 | 2101 | SLog::Write(LOGLEVEL_WARN, sprintf("Grommunio->adviseStoreToSink(): failed to advised store '%s' with code 0x%X. Polling will be performed.", $store, mapi_last_hresult())); |
@@ -2473,7 +2472,7 @@ discard block |
||
| 2473 | 2472 | * @return mapiFolderObject |
| 2474 | 2473 | */ |
| 2475 | 2474 | private function createSearchFolder($searchFolderRoot) { |
| 2476 | - $folderName = 'grommunio-sync Search Folder ' . @getmypid(); |
|
| 2475 | + $folderName = 'grommunio-sync Search Folder '.@getmypid(); |
|
| 2477 | 2476 | $searchFolders = mapi_folder_gethierarchytable($searchFolderRoot); |
| 2478 | 2477 | $restriction = [ |
| 2479 | 2478 | RES_CONTENT, |
@@ -2522,7 +2521,7 @@ discard block |
||
| 2522 | 2521 | $resOr, |
| 2523 | 2522 | [RES_CONTENT, |
| 2524 | 2523 | [ |
| 2525 | - FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, |
|
| 2524 | + FUZZYLEVEL => FL_SUBSTRING|FL_IGNORECASE, |
|
| 2526 | 2525 | ULPROPTAG => $property, |
| 2527 | 2526 | VALUE => u2w($term), |
| 2528 | 2527 | ], |
@@ -305,7 +305,7 @@ |
||
| 305 | 305 | // (!EXIST(recurrence_enddate_property) && item[isRecurring] == true && item[start] <= end) |
| 306 | 306 | && !isset($p[$props['recurrenceend']]) && true == $p[$props['isrecurring']] && $p[$props['starttime']] <= $end |
| 307 | 307 | ) |
| 308 | - ) { |
|
| 308 | + ) { |
|
| 309 | 309 | SLog::Write(LOGLEVEL_DEBUG, 'MAPIUtils->IsInCalendarSyncInterval: Message is in the synchronization interval'); |
| 310 | 310 | |
| 311 | 311 | return true; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | ], |
| 121 | 121 | ], // EXISTS OR |
| 122 | 122 | ], |
| 123 | - ]; // global OR |
|
| 123 | + ]; // global OR |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | [ |
| 151 | 151 | [RES_OR, |
| 152 | 152 | [ |
| 153 | - [RES_CONTENT, [FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, ULPROPTAG => PR_DISPLAY_NAME, VALUE => $query]], |
|
| 154 | - [RES_CONTENT, [FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, ULPROPTAG => PR_ACCOUNT, VALUE => $query]], |
|
| 155 | - [RES_CONTENT, [FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, ULPROPTAG => PR_SMTP_ADDRESS, VALUE => $query]], |
|
| 153 | + [RES_CONTENT, [FUZZYLEVEL => FL_SUBSTRING|FL_IGNORECASE, ULPROPTAG => PR_DISPLAY_NAME, VALUE => $query]], |
|
| 154 | + [RES_CONTENT, [FUZZYLEVEL => FL_SUBSTRING|FL_IGNORECASE, ULPROPTAG => PR_ACCOUNT, VALUE => $query]], |
|
| 155 | + [RES_CONTENT, [FUZZYLEVEL => FL_SUBSTRING|FL_IGNORECASE, ULPROPTAG => PR_SMTP_ADDRESS, VALUE => $query]], |
|
| 156 | 156 | ], // RES_OR |
| 157 | 157 | ], |
| 158 | 158 | [RES_OR, |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | PR_SENT_REPRESENTING_ENTRYID => $props[PR_SENT_REPRESENTING_ENTRYID], |
| 622 | 622 | PR_SENT_REPRESENTING_SEARCH_KEY => $props[PR_SENT_REPRESENTING_SEARCH_KEY], |
| 623 | 623 | // mark the message as read if the main message has read flag |
| 624 | - PR_MESSAGE_FLAGS => $read ? $mprops[PR_MESSAGE_FLAGS] | MSGFLAG_READ : $mprops[PR_MESSAGE_FLAGS], |
|
| 624 | + PR_MESSAGE_FLAGS => $read ? $mprops[PR_MESSAGE_FLAGS]|MSGFLAG_READ : $mprops[PR_MESSAGE_FLAGS], |
|
| 625 | 625 | ]); |
| 626 | 626 | } |
| 627 | 627 | // TODO check if we need to do this for encrypted (and signed?) message as well |
@@ -691,13 +691,13 @@ discard block |
||
| 691 | 691 | $entryId = strtoupper($entryid); |
| 692 | 692 | |
| 693 | 693 | $res = [ |
| 694 | - 'abFlags' => '', // BYTE[4], 4 bytes, 8 hex characters |
|
| 695 | - 'guid' => '', // GUID, 16 bytes, 32 hex characters |
|
| 696 | - 'version' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 697 | - 'type' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 698 | - 'id' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 699 | - 'server' => '', // CHAR, variable length |
|
| 700 | - 'padding' => '', // TCHAR[3], 4 bytes, 8 hex characters (upto 4 bytes) |
|
| 694 | + 'abFlags' => '', // BYTE[4], 4 bytes, 8 hex characters |
|
| 695 | + 'guid' => '', // GUID, 16 bytes, 32 hex characters |
|
| 696 | + 'version' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 697 | + 'type' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 698 | + 'id' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 699 | + 'server' => '', // CHAR, variable length |
|
| 700 | + 'padding' => '', // TCHAR[3], 4 bytes, 8 hex characters (upto 4 bytes) |
|
| 701 | 701 | ]; |
| 702 | 702 | |
| 703 | 703 | $res['length'] = strlen($entryId); |
@@ -742,13 +742,13 @@ discard block |
||
| 742 | 742 | $entryId = strtoupper($entryid); |
| 743 | 743 | |
| 744 | 744 | $res = [ |
| 745 | - 'abFlags' => '', // BYTE[4], 4 bytes, 8 hex characters |
|
| 746 | - 'guid' => '', // GUID, 16 bytes, 32 hex characters |
|
| 747 | - 'version' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 748 | - 'type' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 749 | - 'uniqueId' => '', // ULONG, 16 bytes, 32 hex characters |
|
| 750 | - 'server' => '', // CHAR, variable length |
|
| 751 | - 'padding' => '', // TCHAR[3], 4 bytes, 8 hex characters (upto 4 bytes) |
|
| 745 | + 'abFlags' => '', // BYTE[4], 4 bytes, 8 hex characters |
|
| 746 | + 'guid' => '', // GUID, 16 bytes, 32 hex characters |
|
| 747 | + 'version' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 748 | + 'type' => '', // ULONG, 4 bytes, 8 hex characters |
|
| 749 | + 'uniqueId' => '', // ULONG, 16 bytes, 32 hex characters |
|
| 750 | + 'server' => '', // CHAR, variable length |
|
| 751 | + 'padding' => '', // TCHAR[3], 4 bytes, 8 hex characters (upto 4 bytes) |
|
| 752 | 752 | ]; |
| 753 | 753 | |
| 754 | 754 | $res['length'] = strlen($entryId); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $folderidHex = bin2hex($folderid); |
| 46 | 46 | $folderid = GSync::GetDeviceManager()->GetFolderIdForBackendId($folderidHex); |
| 47 | 47 | if ($folderid != $folderidHex) { |
| 48 | - $this->prefix = $folderid . ':'; |
|
| 48 | + $this->prefix = $folderid.':'; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | $message->flags = $flags; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - $this->importer->ImportMessageChange($this->prefix . bin2hex($sourcekey), $message); |
|
| 142 | - SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageChange(): change for: '%s'", $this->prefix . bin2hex($sourcekey))); |
|
| 141 | + $this->importer->ImportMessageChange($this->prefix.bin2hex($sourcekey), $message); |
|
| 142 | + SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageChange(): change for: '%s'", $this->prefix.bin2hex($sourcekey))); |
|
| 143 | 143 | |
| 144 | 144 | // Tell MAPI it doesn't need to do anything itself, as we've done all the work already. |
| 145 | 145 | return SYNC_E_IGNORE; |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | foreach ($sourcekeys as $sourcekey) { |
| 161 | 161 | // TODO if we would know that ICS is removing the message because it's outside the sync interval, we could send a $asSoftDelete = true to the importer. Could they pass that via $flags? |
| 162 | - $this->importer->ImportMessageDeletion($this->prefix . bin2hex($sourcekey)); |
|
| 163 | - SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageDeletion(): delete for :'%s'", $this->prefix . bin2hex($sourcekey))); |
|
| 162 | + $this->importer->ImportMessageDeletion($this->prefix.bin2hex($sourcekey)); |
|
| 163 | + SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageDeletion(): delete for :'%s'", $this->prefix.bin2hex($sourcekey))); |
|
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public function ImportPerUserReadStateChange($readstates) { |
| 175 | 175 | foreach ($readstates as $readstate) { |
| 176 | - $this->importer->ImportMessageReadFlag($this->prefix . bin2hex($readstate['sourcekey']), $readstate['flags'] & MSGFLAG_READ); |
|
| 177 | - SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportPerUserReadStateChange(): read for :'%s'", $this->prefix . bin2hex($readstate['sourcekey']))); |
|
| 176 | + $this->importer->ImportMessageReadFlag($this->prefix.bin2hex($readstate['sourcekey']), $readstate['flags'] & MSGFLAG_READ); |
|
| 177 | + SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportPerUserReadStateChange(): read for :'%s'", $this->prefix.bin2hex($readstate['sourcekey']))); |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | |
@@ -2263,8 +2263,8 @@ |
||
| 2263 | 2263 | */ |
| 2264 | 2264 | private function getTZFromMAPIBlob($data) { |
| 2265 | 2265 | return unpack('lbias/lstdbias/ldstbias/' . |
| 2266 | - 'vconst1/vdstendyear/vdstendmonth/vdstendday/vdstendweek/vdstendhour/vdstendminute/vdstendsecond/vdstendmillis/' . |
|
| 2267 | - 'vconst2/vdststartyear/vdststartmonth/vdststartday/vdststartweek/vdststarthour/vdststartminute/vdststartsecond/vdststartmillis', $data); |
|
| 2266 | + 'vconst1/vdstendyear/vdstendmonth/vdstendday/vdstendweek/vdstendhour/vdstendminute/vdstendsecond/vdstendmillis/' . |
|
| 2267 | + 'vconst2/vdststartyear/vdststartmonth/vdststartday/vdststartweek/vdststarthour/vdststartminute/vdststartsecond/vdststartmillis', $data); |
|
| 2268 | 2268 | } |
| 2269 | 2269 | |
| 2270 | 2270 | /** |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | switch ($recurrence->recur['type']) { |
| 829 | 829 | case 10: |
| 830 | 830 | if (0 == $recurrence->recur['subtype']) { |
| 831 | - $syncRecurrence->interval = (int) ($recurrence->recur['everyn'] / 1440); |
|
| 831 | + $syncRecurrence->interval = (int)($recurrence->recur['everyn'] / 1440); |
|
| 832 | 832 | } // minutes |
| 833 | 833 | |
| 834 | 834 | break; |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | break; // months / weeks |
| 841 | 841 | |
| 842 | 842 | case 13: |
| 843 | - $syncRecurrence->interval = (int) ($recurrence->recur['everyn'] / 12); |
|
| 843 | + $syncRecurrence->interval = (int)($recurrence->recur['everyn'] / 12); |
|
| 844 | 844 | |
| 845 | 845 | break; // months |
| 846 | 846 | } |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | $syncRecurrence->weekofmonth = $recurrence->recur['nday']; |
| 853 | 853 | } // N'th {DAY} of {X} (0-5) |
| 854 | 854 | if (isset($recurrence->recur['month'])) { |
| 855 | - $syncRecurrence->monthofyear = (int) ($recurrence->recur['month'] / (60 * 24 * 29)) + 1; |
|
| 855 | + $syncRecurrence->monthofyear = (int)($recurrence->recur['month'] / (60 * 24 * 29)) + 1; |
|
| 856 | 856 | } // works ok due to rounding. see also $monthminutes below (1-12) |
| 857 | 857 | if (isset($recurrence->recur['monthday'])) { |
| 858 | 858 | $syncRecurrence->dayofmonth = $recurrence->recur['monthday']; |
@@ -1005,9 +1005,9 @@ discard block |
||
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | 1007 | if ($fromname) { |
| 1008 | - $from = '"' . w2u($fromname) . '" <' . w2u($fromaddr) . '>'; |
|
| 1008 | + $from = '"'.w2u($fromname).'" <'.w2u($fromaddr).'>'; |
|
| 1009 | 1009 | } else { // START CHANGED dw2412 HTC shows "error" if sender name is unknown |
| 1010 | - $from = '"' . w2u($fromaddr) . '" <' . w2u($fromaddr) . '>'; |
|
| 1010 | + $from = '"'.w2u($fromaddr).'" <'.w2u($fromaddr).'>'; |
|
| 1011 | 1011 | } |
| 1012 | 1012 | // END CHANGED dw2412 HTC shows "error" if sender name is unknown |
| 1013 | 1013 | |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | $mime = explode('/', $mimetype); |
| 1206 | 1206 | |
| 1207 | 1207 | if (2 == count($mime) && 'image' == $mime[0]) { |
| 1208 | - $attach->displayname = 'inline.' . $mime[1]; |
|
| 1208 | + $attach->displayname = 'inline.'.$mime[1]; |
|
| 1209 | 1209 | } |
| 1210 | 1210 | } |
| 1211 | 1211 | |
@@ -1302,9 +1302,9 @@ discard block |
||
| 1302 | 1302 | $fulladdr = w2u($address); |
| 1303 | 1303 | } else { |
| 1304 | 1304 | if ('"' != substr($name, 0, 1) && '"' != substr($name, -1)) { |
| 1305 | - $fulladdr = '"' . w2u($name) . '" <' . w2u($address) . '>'; |
|
| 1305 | + $fulladdr = '"'.w2u($name).'" <'.w2u($address).'>'; |
|
| 1306 | 1306 | } else { |
| 1307 | - $fulladdr = w2u($name) . '<' . w2u($address) . '>'; |
|
| 1307 | + $fulladdr = w2u($name).'<'.w2u($address).'>'; |
|
| 1308 | 1308 | } |
| 1309 | 1309 | } |
| 1310 | 1310 | |
@@ -1636,8 +1636,7 @@ discard block |
||
| 1636 | 1636 | if (isset($exception->asbody)) { |
| 1637 | 1637 | $this->setASbody($exception->asbody, $exceptionprops, $appointmentprops); |
| 1638 | 1638 | $mapiexception['body'] = $exceptionprops[$appointmentprops['body']] = |
| 1639 | - (isset($exceptionprops[$appointmentprops['body']])) ? $exceptionprops[$appointmentprops['body']] : |
|
| 1640 | - ((isset($exceptionprops[$appointmentprops['html']])) ? $exceptionprops[$appointmentprops['html']] : ''); |
|
| 1639 | + (isset($exceptionprops[$appointmentprops['body']])) ? $exceptionprops[$appointmentprops['body']] : ((isset($exceptionprops[$appointmentprops['html']])) ? $exceptionprops[$appointmentprops['html']] : ''); |
|
| 1641 | 1640 | } |
| 1642 | 1641 | |
| 1643 | 1642 | array_push($recur['changed_occurences'], $mapiexception); |
@@ -1676,7 +1675,7 @@ discard block |
||
| 1676 | 1675 | $props[$appointmentprops['representingname']] = (false !== $displayname) ? $displayname : Request::GetUser(); |
| 1677 | 1676 | $props[$appointmentprops['sentrepresentingemail']] = Request::GetUser(); |
| 1678 | 1677 | $props[$appointmentprops['sentrepresentingaddt']] = 'ZARAFA'; |
| 1679 | - $props[$appointmentprops['sentrepresentinsrchk']] = $props[$appointmentprops['sentrepresentingaddt']] . ':' . $props[$appointmentprops['sentrepresentingemail']]; |
|
| 1678 | + $props[$appointmentprops['sentrepresentinsrchk']] = $props[$appointmentprops['sentrepresentingaddt']].':'.$props[$appointmentprops['sentrepresentingemail']]; |
|
| 1680 | 1679 | |
| 1681 | 1680 | if (isset($appointment->attendees) && is_array($appointment->attendees) && !empty($appointment->attendees)) { |
| 1682 | 1681 | $props[$appointmentprops['icon']] = 1026; |
@@ -1710,7 +1709,7 @@ discard block |
||
| 1710 | 1709 | $org[PR_ADDRTYPE] = isset($representingprops[$appointmentprops['sentrepresentingaddt']]) ? $representingprops[$appointmentprops['sentrepresentingaddt']] : $props[$appointmentprops['sentrepresentingaddt']]; |
| 1711 | 1710 | $org[PR_SMTP_ADDRESS] = $org[PR_EMAIL_ADDRESS] = isset($representingprops[$appointmentprops['sentrepresentingemail']]) ? $representingprops[$appointmentprops['sentrepresentingemail']] : $props[$appointmentprops['sentrepresentingemail']]; |
| 1712 | 1711 | $org[PR_SEARCH_KEY] = isset($representingprops[$appointmentprops['sentrepresentinsrchk']]) ? $representingprops[$appointmentprops['sentrepresentinsrchk']] : $props[$appointmentprops['sentrepresentinsrchk']]; |
| 1713 | - $org[PR_RECIPIENT_FLAGS] = recipOrganizer | recipSendable; |
|
| 1712 | + $org[PR_RECIPIENT_FLAGS] = recipOrganizer|recipSendable; |
|
| 1714 | 1713 | $org[PR_RECIPIENT_TYPE] = MAPI_ORIG; |
| 1715 | 1714 | |
| 1716 | 1715 | array_push($recips, $org); |
@@ -1736,7 +1735,7 @@ discard block |
||
| 1736 | 1735 | $recip[PR_RECIPIENT_TRACKSTATUS] = isset($attendee->attendeestatus) ? $attendee->attendeestatus : olResponseNone; |
| 1737 | 1736 | } else { |
| 1738 | 1737 | $recip[PR_DISPLAY_NAME] = u2w($attendee->name); |
| 1739 | - $recip[PR_SEARCH_KEY] = 'SMTP:' . $recip[PR_EMAIL_ADDRESS] . "\0"; |
|
| 1738 | + $recip[PR_SEARCH_KEY] = 'SMTP:'.$recip[PR_EMAIL_ADDRESS]."\0"; |
|
| 1740 | 1739 | $recip[PR_ADDRTYPE] = 'SMTP'; |
| 1741 | 1740 | $recip[PR_RECIPIENT_TYPE] = isset($attendee->attendeetype) ? $attendee->attendeetype : MAPI_TO; |
| 1742 | 1741 | $recip[PR_ENTRYID] = mapi_createoneoff($recip[PR_DISPLAY_NAME], $recip[PR_ADDRTYPE], $recip[PR_EMAIL_ADDRESS]); |
@@ -2262,8 +2261,8 @@ discard block |
||
| 2262 | 2261 | * @return array |
| 2263 | 2262 | */ |
| 2264 | 2263 | private function getTZFromMAPIBlob($data) { |
| 2265 | - return unpack('lbias/lstdbias/ldstbias/' . |
|
| 2266 | - 'vconst1/vdstendyear/vdstendmonth/vdstendday/vdstendweek/vdstendhour/vdstendminute/vdstendsecond/vdstendmillis/' . |
|
| 2264 | + return unpack('lbias/lstdbias/ldstbias/'. |
|
| 2265 | + 'vconst1/vdstendyear/vdstendmonth/vdstendday/vdstendweek/vdstendhour/vdstendminute/vdstendsecond/vdstendmillis/'. |
|
| 2267 | 2266 | 'vconst2/vdststartyear/vdststartmonth/vdststartday/vdststartweek/vdststarthour/vdststartminute/vdststartsecond/vdststartmillis', $data); |
| 2268 | 2267 | } |
| 2269 | 2268 | |
@@ -2275,8 +2274,8 @@ discard block |
||
| 2275 | 2274 | * @return array |
| 2276 | 2275 | */ |
| 2277 | 2276 | private function getTZFromSyncBlob($data) { |
| 2278 | - $tz = unpack('lbias/a64tzname/vdstendyear/vdstendmonth/vdstendday/vdstendweek/vdstendhour/vdstendminute/vdstendsecond/vdstendmillis/' . |
|
| 2279 | - 'lstdbias/a64tznamedst/vdststartyear/vdststartmonth/vdststartday/vdststartweek/vdststarthour/vdststartminute/vdststartsecond/vdststartmillis/' . |
|
| 2277 | + $tz = unpack('lbias/a64tzname/vdstendyear/vdstendmonth/vdstendday/vdstendweek/vdstendhour/vdstendminute/vdstendsecond/vdstendmillis/'. |
|
| 2278 | + 'lstdbias/a64tznamedst/vdststartyear/vdststartmonth/vdststartday/vdststartweek/vdststarthour/vdststartminute/vdststartsecond/vdststartmillis/'. |
|
| 2280 | 2279 | 'ldstbias', $data); |
| 2281 | 2280 | |
| 2282 | 2281 | // Make the structure compatible with class.recurrence.php |
@@ -2295,7 +2294,7 @@ discard block |
||
| 2295 | 2294 | */ |
| 2296 | 2295 | private function getMAPIBlobFromTZ($tz) { |
| 2297 | 2296 | return pack( |
| 2298 | - 'lll' . 'vvvvvvvvv' . 'vvvvvvvvv', |
|
| 2297 | + 'lll'.'vvvvvvvvv'.'vvvvvvvvv', |
|
| 2299 | 2298 | $tz['bias'], |
| 2300 | 2299 | $tz['stdbias'], |
| 2301 | 2300 | $tz['dstbias'], |
@@ -2526,11 +2525,11 @@ discard block |
||
| 2526 | 2525 | */ |
| 2527 | 2526 | private function composeDisplayName(&$contact) { |
| 2528 | 2527 | // Set display name and subject to a combined value of firstname and lastname |
| 2529 | - $cname = (isset($contact->prefix)) ? u2w($contact->prefix) . ' ' : ''; |
|
| 2528 | + $cname = (isset($contact->prefix)) ? u2w($contact->prefix).' ' : ''; |
|
| 2530 | 2529 | $cname .= u2w($contact->firstname); |
| 2531 | - $cname .= (isset($contact->middlename)) ? ' ' . u2w($contact->middlename) : ''; |
|
| 2532 | - $cname .= ' ' . u2w($contact->lastname); |
|
| 2533 | - $cname .= (isset($contact->suffix)) ? ' ' . u2w($contact->suffix) : ''; |
|
| 2530 | + $cname .= (isset($contact->middlename)) ? ' '.u2w($contact->middlename) : ''; |
|
| 2531 | + $cname .= ' '.u2w($contact->lastname); |
|
| 2532 | + $cname .= (isset($contact->suffix)) ? ' '.u2w($contact->suffix) : ''; |
|
| 2534 | 2533 | |
| 2535 | 2534 | return trim($cname); |
| 2536 | 2535 | } |
@@ -2558,7 +2557,7 @@ discard block |
||
| 2558 | 2557 | $props[$properties["emailaddresstype{$cnt}"]] = 'SMTP'; |
| 2559 | 2558 | $props[$properties["emailaddressentryid{$cnt}"]] = mapi_createoneoff($name, 'SMTP', $emailAddress); |
| 2560 | 2559 | $nremails[] = $cnt - 1; |
| 2561 | - $abprovidertype |= 2 ^ ($cnt - 1); |
|
| 2560 | + $abprovidertype |= 2^($cnt - 1); |
|
| 2562 | 2561 | } |
| 2563 | 2562 | } |
| 2564 | 2563 | |
@@ -2578,29 +2577,29 @@ discard block |
||
| 2578 | 2577 | */ |
| 2579 | 2578 | private function setAddress($type, &$city, &$country, &$postalcode, &$state, &$street, &$props, &$properties) { |
| 2580 | 2579 | if (isset($city)) { |
| 2581 | - $props[$properties[$type . 'city']] = $city = u2w($city); |
|
| 2580 | + $props[$properties[$type.'city']] = $city = u2w($city); |
|
| 2582 | 2581 | } |
| 2583 | 2582 | |
| 2584 | 2583 | if (isset($country)) { |
| 2585 | - $props[$properties[$type . 'country']] = $country = u2w($country); |
|
| 2584 | + $props[$properties[$type.'country']] = $country = u2w($country); |
|
| 2586 | 2585 | } |
| 2587 | 2586 | |
| 2588 | 2587 | if (isset($postalcode)) { |
| 2589 | - $props[$properties[$type . 'postalcode']] = $postalcode = u2w($postalcode); |
|
| 2588 | + $props[$properties[$type.'postalcode']] = $postalcode = u2w($postalcode); |
|
| 2590 | 2589 | } |
| 2591 | 2590 | |
| 2592 | 2591 | if (isset($state)) { |
| 2593 | - $props[$properties[$type . 'state']] = $state = u2w($state); |
|
| 2592 | + $props[$properties[$type.'state']] = $state = u2w($state); |
|
| 2594 | 2593 | } |
| 2595 | 2594 | |
| 2596 | 2595 | if (isset($street)) { |
| 2597 | - $props[$properties[$type . 'street']] = $street = u2w($street); |
|
| 2596 | + $props[$properties[$type.'street']] = $street = u2w($street); |
|
| 2598 | 2597 | } |
| 2599 | 2598 | |
| 2600 | 2599 | // set composed address |
| 2601 | 2600 | $address = Utils::BuildAddressString($street, $postalcode, $city, $state, $country); |
| 2602 | 2601 | if ($address) { |
| 2603 | - $props[$properties[$type . 'address']] = $address; |
|
| 2602 | + $props[$properties[$type.'address']] = $address; |
|
| 2604 | 2603 | } |
| 2605 | 2604 | } |
| 2606 | 2605 | |
@@ -2773,7 +2772,7 @@ discard block |
||
| 2773 | 2772 | return false; |
| 2774 | 2773 | } |
| 2775 | 2774 | |
| 2776 | - return $parsedAddress[0]->mailbox . '@' . $parsedAddress[0]->host; |
|
| 2775 | + return $parsedAddress[0]->mailbox.'@'.$parsedAddress[0]->host; |
|
| 2777 | 2776 | } |
| 2778 | 2777 | |
| 2779 | 2778 | /** |