@@ -26,17 +26,17 @@ |
||
| 26 | 26 | |
| 27 | 27 | // used by distribution lists |
| 28 | 28 | define("WAB_GUID", pack("H*", "C091ADD3519DCF11A4A900AA0047FAA4")); |
| 29 | - define("DL_USER", 0xC3); // 195 |
|
| 30 | - define("DL_USER2", 0xD3); // 211 |
|
| 31 | - define("DL_USER3", 0xE3); // 227 |
|
| 29 | + define("DL_USER", 0xC3); // 195 |
|
| 30 | + define("DL_USER2", 0xD3); // 211 |
|
| 31 | + define("DL_USER3", 0xE3); // 227 |
|
| 32 | 32 | /* |
| 33 | 33 | * According to Exchange protocol, type property for oneoff contact |
| 34 | 34 | * will be 0x00. |
| 35 | 35 | */ |
| 36 | - define("DL_EXTERNAL_MEMBER", 0x00); // 0 |
|
| 37 | - define("DL_DIST", 0xB4); // 180 |
|
| 38 | - define("DL_USER_AB", 0xB5); // 181 |
|
| 39 | - define("DL_DIST_AB", 0xB6); // 182 |
|
| 36 | + define("DL_EXTERNAL_MEMBER", 0x00); // 0 |
|
| 37 | + define("DL_DIST", 0xB4); // 180 |
|
| 38 | + define("DL_USER_AB", 0xB5); // 181 |
|
| 39 | + define("DL_DIST_AB", 0xB6); // 182 |
|
| 40 | 40 | |
| 41 | 41 | // @FIXME these needs to be changed in mapitags.php |
| 42 | 42 | |
@@ -2067,9 +2067,9 @@ discard block |
||
| 2067 | 2067 | $messageProps = []; |
| 2068 | 2068 | // It stores the values that is exception allowed or not false -> not allowed |
| 2069 | 2069 | $isExceptionAllowed = true; |
| 2070 | - $delete = $actionType == 'delete'; // Flag for MeetingRequest Class whether to send update or cancel mail. |
|
| 2071 | - $basedate = false; // Flag for MeetingRequest Class whether to send an exception or not. |
|
| 2072 | - $isReminderTimeAllowed = true; // Flag to check reminder minutes is in range of the occurrences |
|
| 2070 | + $delete = $actionType == 'delete'; // Flag for MeetingRequest Class whether to send update or cancel mail. |
|
| 2071 | + $basedate = false; // Flag for MeetingRequest Class whether to send an exception or not. |
|
| 2072 | + $isReminderTimeAllowed = true; // Flag to check reminder minutes is in range of the occurrences |
|
| 2073 | 2073 | $properties = $GLOBALS['properties']->getAppointmentProperties(); |
| 2074 | 2074 | $send = false; |
| 2075 | 2075 | $oldProps = []; |
@@ -3060,7 +3060,7 @@ discard block |
||
| 3060 | 3060 | * convert flags of PR_MESSAGE_FLAGS property to flags that is |
| 3061 | 3061 | * used in mapi_message_setreadflag. |
| 3062 | 3062 | */ |
| 3063 | - $flag = MAPI_DEFERRED_ERRORS; // set unread flag, read receipt will be sent |
|
| 3063 | + $flag = MAPI_DEFERRED_ERRORS; // set unread flag, read receipt will be sent |
|
| 3064 | 3064 | |
| 3065 | 3065 | if (($flags & MSGFLAG_RN_PENDING) && isset($msg_action['send_read_receipt']) && $msg_action['send_read_receipt'] == false) { |
| 3066 | 3066 | $flag |= SUPPRESS_RECEIPT; |
@@ -4201,7 +4201,7 @@ discard block |
||
| 4201 | 4201 | try { |
| 4202 | 4202 | $oneoff = mapi_parseoneoff($entryid); |
| 4203 | 4203 | } |
| 4204 | - catch(MAPIException $ex) { |
|
| 4204 | + catch (MAPIException $ex) { |
|
| 4205 | 4205 | error_log(sprintf( |
| 4206 | 4206 | "readReplyRecipientEntry unable to open AB entry and mapi_parseoneoff failed: %s - %s", |
| 4207 | 4207 | get_mapi_error_name($ex->getCode()), |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | else { |
| 144 | 144 | $first = true; |
| 145 | 145 | foreach ($search_patterns as $key => $search_pattern) { |
| 146 | - switch($key) { |
|
| 146 | + switch ($key) { |
|
| 147 | 147 | case 'message_classes': |
| 148 | 148 | case 'date_start': |
| 149 | 149 | case 'date_end': |
@@ -178,13 +178,13 @@ discard block |
||
| 178 | 178 | $user = $this->getUser($store_props[PR_USER_ENTRYID]); |
| 179 | 179 | |
| 180 | 180 | // receive userdata |
| 181 | - $user_props = [ PR_ASSISTANT, PR_ASSISTANT_TELEPHONE_NUMBER, PR_BUSINESS2_TELEPHONE_NUMBER, PR_BUSINESS_TELEPHONE_NUMBER, |
|
| 181 | + $user_props = [PR_ASSISTANT, PR_ASSISTANT_TELEPHONE_NUMBER, PR_BUSINESS2_TELEPHONE_NUMBER, PR_BUSINESS_TELEPHONE_NUMBER, |
|
| 182 | 182 | PR_COMPANY_NAME, PR_COUNTRY, PR_DEPARTMENT_NAME, PR_DISPLAY_NAME, |
| 183 | 183 | PR_EMAIL_ADDRESS, PR_EMS_AB_THUMBNAIL_PHOTO, PR_GIVEN_NAME, PR_HOME2_TELEPHONE_NUMBER, |
| 184 | 184 | PR_STREET_ADDRESS, PR_HOME_TELEPHONE_NUMBER, PR_INITIALS, PR_LOCALITY, |
| 185 | 185 | PR_MOBILE_TELEPHONE_NUMBER, PR_OFFICE_LOCATION, PR_PAGER_TELEPHONE_NUMBER, PR_POSTAL_CODE, |
| 186 | 186 | PR_PRIMARY_FAX_NUMBER, PR_PRIMARY_TELEPHONE_NUMBER, PR_SEARCH_KEY, PR_SMTP_ADDRESS, |
| 187 | - PR_STATE_OR_PROVINCE, PR_SURNAME, PR_TITLE ]; |
|
| 187 | + PR_STATE_OR_PROVINCE, PR_SURNAME, PR_TITLE]; |
|
| 188 | 188 | |
| 189 | 189 | $user_props = mapi_getprops($user, $user_props); |
| 190 | 190 | |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | // Postfix display name of every contact folder with respective owner name |
| 1095 | 1095 | // it is mandatory to keep display-name different |
| 1096 | 1096 | $userStoreProps = mapi_getprops($openedUserStore, [PR_MAILBOX_OWNER_NAME]); |
| 1097 | - for ($i = 0,$len = count($userContactFolders); $i < $len; ++$i) { |
|
| 1097 | + for ($i = 0, $len = count($userContactFolders); $i < $len; ++$i) { |
|
| 1098 | 1098 | $userContactFolders[$i][PR_DISPLAY_NAME] = $userContactFolders[$i][PR_DISPLAY_NAME] . " - " . $userStoreProps[PR_MAILBOX_OWNER_NAME]; |
| 1099 | 1099 | } |
| 1100 | 1100 | |
@@ -354,8 +354,7 @@ discard block |
||
| 354 | 354 | function sorter($direction, $key) { |
| 355 | 355 | return function($a, $b) use ($direction, $key) { |
| 356 | 356 | return $direction == 'ASC' ? |
| 357 | - strcasecmp($a['props'][$key] ?? '', $b['props'][$key] ?? '') : |
|
| 358 | - strcasecmp($b['props'][$key] ?? '', $a['props'][$key] ?? ''); |
|
| 357 | + strcasecmp($a['props'][$key] ?? '', $b['props'][$key] ?? '') : strcasecmp($b['props'][$key] ?? '', $a['props'][$key] ?? ''); |
|
| 359 | 358 | }; |
| 360 | 359 | } |
| 361 | 360 | usort($items, sorter($sortingDir, $sortingField)); |
@@ -760,7 +759,7 @@ discard block |
||
| 760 | 759 | ], |
| 761 | 760 | [ |
| 762 | 761 | RES_OR, |
| 763 | - $tempRestrictions, // all group restrictions |
|
| 762 | + $tempRestrictions, // all group restrictions |
|
| 764 | 763 | ], |
| 765 | 764 | ], |
| 766 | 765 | ], |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | $result = $this->post("Authentication/LogonWithToken", $logonParameters);
|
| 54 | 54 | $this->ConnectionId = $result->LogonWithTokenResult->ConnectionId; |
| 55 | 55 | return true; |
| 56 | - } catch(\Exception $ex) {
|
|
| 57 | - throw new \Exception("Token-Login failed: ".$ex->getMessage());
|
|
| 56 | + } catch (\Exception $ex) {
|
|
| 57 | + throw new \Exception("Token-Login failed: " . $ex->getMessage());
|
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | $result = $this->post("Authentication/Logout", $logoutParameters);
|
| 72 | 72 | $this->ConnectionId = null; |
| 73 | 73 | return true; |
| 74 | - } catch(\Exception $ex) {
|
|
| 75 | - throw new \Exception("Token-Login failed: ".$ex->getMessage());
|
|
| 74 | + } catch (\Exception $ex) {
|
|
| 75 | + throw new \Exception("Token-Login failed: " . $ex->getMessage());
|
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | $result = $this->post("UserTable/UserTableGetRecords", $parameters);
|
| 97 | 97 | if (!isset($result->UserTableGetRecordsResult)) throw new \Exception("Unexpected result");
|
| 98 | 98 | return $result->UserTableGetRecordsResult; |
| 99 | - } catch(\Exception $ex) {
|
|
| 100 | - throw new \Exception("User table query failed: ".$ex->getMessage());
|
|
| 99 | + } catch (\Exception $ex) {
|
|
| 100 | + throw new \Exception("User table query failed: " . $ex->getMessage());
|
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | {
|
| 142 | 142 | $ch = curl_init(); |
| 143 | 143 | //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
| 144 | - curl_setopt($ch, CURLOPT_URL, $this->ServiceEndpoint.$path); |
|
| 144 | + curl_setopt($ch, CURLOPT_URL, $this->ServiceEndpoint . $path); |
|
| 145 | 145 | curl_setopt($ch, CURLOPT_POST, 1); |
| 146 | 146 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); |
| 147 | 147 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 148 | 148 | curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); |
| 149 | 149 | $jsonResult = curl_exec($ch); |
| 150 | 150 | if (curl_errno($ch)) {
|
| 151 | - throw new \Exception("Error on post request: ".curl_errno($ch));
|
|
| 151 | + throw new \Exception("Error on post request: " . curl_errno($ch));
|
|
| 152 | 152 | } |
| 153 | 153 | return $this->handleJsonResult($jsonResult); |
| 154 | 154 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | $result = json_decode($json); |
| 163 | 163 | if (isset($result->ErrorNumber)) {
|
| 164 | - throw new \Exception("(".$result->ErrorNumber.") ".$result->Message);
|
|
| 164 | + throw new \Exception("(" . $result->ErrorNumber . ") " . $result->Message);
|
|
| 165 | 165 | } |
| 166 | 166 | return $result; |
| 167 | 167 | } |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | xmlwriter_end_element($writer); |
| 74 | 74 | xmlwriter_end_element($writer); |
| 75 | 75 | return xmlwriter_output_memory($writer); |
| 76 | - } catch(\Exception $ex) {
|
|
| 77 | - throw new \Exception("Generating token failed: ".$ex->getMessage());
|
|
| 76 | + } catch (\Exception $ex) {
|
|
| 77 | + throw new \Exception("Generating token failed: " . $ex->getMessage());
|
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
@@ -89,15 +89,15 @@ discard block |
||
| 89 | 89 | $pfxContent = file_get_contents($this->PfxFile); |
| 90 | 90 | $results = []; |
| 91 | 91 | $read = openssl_pkcs12_read($pfxContent, $results, $this->PfxPassword); |
| 92 | - if ($read == false) throw new \Exception("Error on reading PFX-File: ".openssl_error_string());
|
|
| 93 | - $this->Certificate = $results['pkey'].$results['cert']; |
|
| 92 | + if ($read == false) throw new \Exception("Error on reading PFX-File: " . openssl_error_string());
|
|
| 93 | + $this->Certificate = $results['pkey'] . $results['cert']; |
|
| 94 | 94 | $this->CertPrivateKey = $results['pkey']; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | private function writeSignedInfo($writer, $userEMail, $time, $uniqueId) |
| 98 | 98 | {
|
| 99 | 99 | $utcTime = $time->format('Y-m-d H:i:s');
|
| 100 | - $utcTime = str_replace(" ", "T", $utcTime)."Z";
|
|
| 100 | + $utcTime = str_replace(" ", "T", $utcTime) . "Z";
|
|
| 101 | 101 | xmlwriter_start_element($writer, "SignedInfo"); |
| 102 | 102 | xmlwriter_start_element($writer, "UserPrincipalName"); |
| 103 | 103 | xmlwriter_text($writer, $userEMail); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $base64 = base64_encode($privateKey->sign($data)); |
| 147 | 147 | return $base64; |
| 148 | 148 | } catch (\Exception $ex) {
|
| 149 | - throw new \Exception("XML signing failed: ".$ex->getMessage());
|
|
| 149 | + throw new \Exception("XML signing failed: " . $ex->getMessage());
|
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
@@ -154,19 +154,19 @@ discard block |
||
| 154 | 154 | * Creates a unique ID |
| 155 | 155 | * @return string |
| 156 | 156 | */ |
| 157 | - private function createGUID(){
|
|
| 158 | - if (function_exists('com_create_guid')){
|
|
| 157 | + private function createGUID() {
|
|
| 158 | + if (function_exists('com_create_guid')) {
|
|
| 159 | 159 | return com_create_guid(); |
| 160 | 160 | } |
| 161 | 161 | else {
|
| 162 | - mt_srand((double)microtime()*10000); |
|
| 162 | + mt_srand((double) microtime() * 10000); |
|
| 163 | 163 | $charid = strtoupper(md5(uniqid(random_int(0, mt_getrandmax()), true))); |
| 164 | - $hyphen = chr(45);// "-" |
|
| 165 | - $uuid = substr($charid, 0, 8).$hyphen |
|
| 166 | - .substr($charid, 8, 4).$hyphen |
|
| 167 | - .substr($charid,12, 4).$hyphen |
|
| 168 | - .substr($charid,16, 4).$hyphen |
|
| 169 | - .substr($charid,20,12); |
|
| 164 | + $hyphen = chr(45); // "-" |
|
| 165 | + $uuid = substr($charid, 0, 8) . $hyphen |
|
| 166 | + .substr($charid, 8, 4) . $hyphen |
|
| 167 | + .substr($charid, 12, 4) . $hyphen |
|
| 168 | + .substr($charid, 16, 4) . $hyphen |
|
| 169 | + .substr($charid, 20, 12); |
|
| 170 | 170 | return $uuid; |
| 171 | 171 | } |
| 172 | 172 | } |
@@ -391,8 +391,8 @@ discard block |
||
| 391 | 391 | $a = mapi_getprops($msg, [PR_TRANSPORT_MESSAGE_HEADERS]); |
| 392 | 392 | $a = $a === false ? "" : ($a[PR_TRANSPORT_MESSAGE_HEADERS] ?? ""); |
| 393 | 393 | $prop[PR_TRANSPORT_MESSAGE_HEADERS] = |
| 394 | - "# Outer headers:\n".($prop[PR_TRANSPORT_MESSAGE_HEADERS] ?? ""). |
|
| 395 | - "# Inner headers:\n".$a; |
|
| 394 | + "# Outer headers:\n" . ($prop[PR_TRANSPORT_MESSAGE_HEADERS] ?? "") . |
|
| 395 | + "# Inner headers:\n" . $a; |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | /** |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | } |
| 513 | 513 | |
| 514 | 514 | if (!encryptionStoreExpirationSupport()) { |
| 515 | - withPHPSession(function () use ($encryptionStore) { |
|
| 515 | + withPHPSession(function() use ($encryptionStore) { |
|
| 516 | 516 | $encryptionStore->add('smime', ''); |
| 517 | 517 | }); |
| 518 | 518 | } |
@@ -1007,7 +1007,7 @@ discard block |
||
| 1007 | 1007 | if (strlen($this->openssl_error) == 0) |
| 1008 | 1008 | $this->openssl_error = $s; |
| 1009 | 1009 | else |
| 1010 | - $this->openssl_error .= "\n".$s; |
|
| 1010 | + $this->openssl_error .= "\n" . $s; |
|
| 1011 | 1011 | $openssl_error_code = 0; |
| 1012 | 1012 | if ($this->openssl_error) { |
| 1013 | 1013 | $openssl_error_list = explode(":", $this->openssl_error); |
@@ -480,8 +480,8 @@ discard block |
||
| 480 | 480 | $a = mapi_getprops($msg, [PR_TRANSPORT_MESSAGE_HEADERS]); |
| 481 | 481 | $a = $a === false ? "" : ($a[PR_TRANSPORT_MESSAGE_HEADERS] ?? ""); |
| 482 | 482 | $prop[PR_TRANSPORT_MESSAGE_HEADERS] = |
| 483 | - "# Outer headers:\n".($prop[PR_TRANSPORT_MESSAGE_HEADERS] ?? ""). |
|
| 484 | - "# Inner headers:\n".$a; |
|
| 483 | + "# Outer headers:\n" . ($prop[PR_TRANSPORT_MESSAGE_HEADERS] ?? "") . |
|
| 484 | + "# Inner headers:\n" . $a; |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | /** |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | PR_SENT_REPRESENTING_SMTP_ADDRESS => $props[PR_SENT_REPRESENTING_SMTP_ADDRESS] ?? '', |
| 547 | 547 | PR_SENT_REPRESENTING_ADDRTYPE => $props[PR_SENT_REPRESENTING_ADDRTYPE] ?? 'SMTP', |
| 548 | 548 | PR_CLIENT_SUBMIT_TIME => $props[PR_CLIENT_SUBMIT_TIME] ?? time(), |
| 549 | - PR_TRANSPORT_MESSAGE_HEADERS => ($props[PR_TRANSPORT_MESSAGE_HEADERS] ?? "").$inner_headers, |
|
| 549 | + PR_TRANSPORT_MESSAGE_HEADERS => ($props[PR_TRANSPORT_MESSAGE_HEADERS] ?? "") . $inner_headers, |
|
| 550 | 550 | ]); |
| 551 | 551 | } |
| 552 | 552 | } |
@@ -1004,8 +1004,7 @@ discard block |
||
| 1004 | 1004 | // on the day before or after. This should be fine for all the |
| 1005 | 1005 | // timezones which do not exceed 12 hour difference to UTC. |
| 1006 | 1006 | $ts = $interval > 0 ? |
| 1007 | - $ts - ($interval < 43200 ? $interval : $interval - 86400) : |
|
| 1008 | - $ts + ($interval > -43200 ? $interval : $interval - 86400); |
|
| 1007 | + $ts - ($interval < 43200 ? $interval : $interval - 86400) : $ts + ($interval > -43200 ? $interval : $interval - 86400); |
|
| 1009 | 1008 | } |
| 1010 | 1009 | |
| 1011 | 1010 | return $ts; |