@@ -360,7 +360,7 @@ |
||
| 360 | 360 | ]; |
| 361 | 361 | $fileDependencies[$filename] = [ |
| 362 | 362 | 'depends' => [], |
| 363 | - 'core' => $core, // Based on tag or on class or on file path? |
|
| 363 | + 'core' => $core, // Based on tag or on class or on file path? |
|
| 364 | 364 | ]; |
| 365 | 365 | |
| 366 | 366 | for ($j = 0, $lenJ = count($class[1]); $j < $lenJ; ++$j) { |
@@ -195,8 +195,7 @@ |
||
| 195 | 195 | // TODO: move logon from MAPISession to here |
| 196 | 196 | |
| 197 | 197 | WebAppAuthentication::$_errorCode = isset($_SESSION['_keycloak_auth']) ? |
| 198 | - WebAppAuthentication::$_mapiSession->logon_token($username, $pass) : |
|
| 199 | - WebAppAuthentication::$_mapiSession->logon($username, $pass, DEFAULT_SERVER); |
|
| 198 | + WebAppAuthentication::$_mapiSession->logon_token($username, $pass) : WebAppAuthentication::$_mapiSession->logon($username, $pass, DEFAULT_SERVER); |
|
| 200 | 199 | |
| 201 | 200 | // Include external login plugins to be loaded |
| 202 | 201 | if (file_exists(BASE_PATH . 'extlogin.php')) { |
@@ -15,31 +15,31 @@ |
||
| 15 | 15 | $tag = $this->peek(); |
| 16 | 16 | |
| 17 | 17 | switch ($tag) { |
| 18 | - case 0: |
|
| 19 | - $res['otherName'] = $this->oid(-6); |
|
| 20 | - break; |
|
| 21 | - |
|
| 22 | - case 1: |
|
| 23 | - $res['rfc822Name'] = $this->next(-22); |
|
| 24 | - break; |
|
| 25 | - |
|
| 26 | - case 2: |
|
| 27 | - $res['dNSName'] = $this->next(-22); |
|
| 28 | - break; |
|
| 29 | - |
|
| 30 | - case 4: |
|
| 31 | - $this->next(4); |
|
| 32 | - $res['directoryName'] = $this->name(); |
|
| 33 | - $res['directoryName_'] = $this->nameasstring($res['directoryName']); |
|
| 34 | - break; |
|
| 35 | - |
|
| 36 | - case 6: |
|
| 37 | - $res['uniformResourceIdentifier'] = $this->next(-22); |
|
| 38 | - break; |
|
| 39 | - |
|
| 40 | - default: |
|
| 41 | - throw new \Exception("Unsupported GeneralName: {$tag}"); |
|
| 42 | -# trigger_error("Unsupported GeneralName: $tag", E_USER_ERROR); |
|
| 18 | + case 0: |
|
| 19 | + $res['otherName'] = $this->oid(-6); |
|
| 20 | + break; |
|
| 21 | + |
|
| 22 | + case 1: |
|
| 23 | + $res['rfc822Name'] = $this->next(-22); |
|
| 24 | + break; |
|
| 25 | + |
|
| 26 | + case 2: |
|
| 27 | + $res['dNSName'] = $this->next(-22); |
|
| 28 | + break; |
|
| 29 | + |
|
| 30 | + case 4: |
|
| 31 | + $this->next(4); |
|
| 32 | + $res['directoryName'] = $this->name(); |
|
| 33 | + $res['directoryName_'] = $this->nameasstring($res['directoryName']); |
|
| 34 | + break; |
|
| 35 | + |
|
| 36 | + case 6: |
|
| 37 | + $res['uniformResourceIdentifier'] = $this->next(-22); |
|
| 38 | + break; |
|
| 39 | + |
|
| 40 | + default: |
|
| 41 | + throw new \Exception("Unsupported GeneralName: {$tag}"); |
|
| 42 | + # trigger_error("Unsupported GeneralName: $tag", E_USER_ERROR); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return $res; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if ($data === CHANGE_PASSPHRASE_SUCCESS) { |
| 57 | 57 | // Reset cached passphrase. |
| 58 | 58 | $encryptionStore = EncryptionStore::getInstance(); |
| 59 | - withPHPSession(function () use ($encryptionStore) { |
|
| 59 | + withPHPSession(function() use ($encryptionStore) { |
|
| 60 | 60 | $encryptionStore->add('smime', ''); |
| 61 | 61 | }); |
| 62 | 62 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $encryptionStore->add('smime', $data['passphrase'], time() + (5 * 60)); |
| 168 | 168 | } |
| 169 | 169 | else { |
| 170 | - withPHPSession(function () use ($encryptionStore, $data) { |
|
| 170 | + withPHPSession(function() use ($encryptionStore, $data) { |
|
| 171 | 171 | $encryptionStore->add('smime', $data['passphrase']); |
| 172 | 172 | }); |
| 173 | 173 | } |
@@ -25,9 +25,11 @@ |
||
| 25 | 25 | * @return bool true on success or false on failure |
| 26 | 26 | */ |
| 27 | 27 | public function execute() { |
| 28 | - foreach ($this->data as $actionType => $actionData) try { |
|
| 28 | + foreach ($this->data as $actionType => $actionData) { |
|
| 29 | + try { |
|
| 29 | 30 | if (!isset($actionType)) |
| 30 | 31 | continue; |
| 32 | + } |
|
| 31 | 33 | switch ($actionType) { |
| 32 | 34 | case 'certificate': |
| 33 | 35 | $data = $this->verifyCertificate($actionData); |
@@ -29,62 +29,62 @@ |
||
| 29 | 29 | if (!isset($actionType)) |
| 30 | 30 | continue; |
| 31 | 31 | switch ($actionType) { |
| 32 | - case 'certificate': |
|
| 33 | - $data = $this->verifyCertificate($actionData); |
|
| 34 | - $response = [ |
|
| 35 | - 'type' => 3, |
|
| 36 | - 'status' => $data['status'], |
|
| 37 | - 'message' => $data['message'], |
|
| 38 | - 'data' => $data['data'], |
|
| 39 | - ]; |
|
| 40 | - $this->addActionData('certificate', $response); |
|
| 41 | - $GLOBALS['bus']->addData($this->getResponseData()); |
|
| 42 | - break; |
|
| 32 | + case 'certificate': |
|
| 33 | + $data = $this->verifyCertificate($actionData); |
|
| 34 | + $response = [ |
|
| 35 | + 'type' => 3, |
|
| 36 | + 'status' => $data['status'], |
|
| 37 | + 'message' => $data['message'], |
|
| 38 | + 'data' => $data['data'], |
|
| 39 | + ]; |
|
| 40 | + $this->addActionData('certificate', $response); |
|
| 41 | + $GLOBALS['bus']->addData($this->getResponseData()); |
|
| 42 | + break; |
|
| 43 | 43 | |
| 44 | - case 'passphrase': |
|
| 45 | - $data = $this->verifyPassphrase($actionData); |
|
| 46 | - $response = [ |
|
| 47 | - 'type' => 3, |
|
| 48 | - 'status' => $data['status'], |
|
| 49 | - ]; |
|
| 50 | - $this->addActionData('passphrase', $response); |
|
| 51 | - $GLOBALS['bus']->addData($this->getResponseData()); |
|
| 52 | - break; |
|
| 44 | + case 'passphrase': |
|
| 45 | + $data = $this->verifyPassphrase($actionData); |
|
| 46 | + $response = [ |
|
| 47 | + 'type' => 3, |
|
| 48 | + 'status' => $data['status'], |
|
| 49 | + ]; |
|
| 50 | + $this->addActionData('passphrase', $response); |
|
| 51 | + $GLOBALS['bus']->addData($this->getResponseData()); |
|
| 52 | + break; |
|
| 53 | 53 | |
| 54 | - case 'changepassphrase': |
|
| 55 | - $data = $this->changePassphrase($actionData); |
|
| 56 | - if ($data === CHANGE_PASSPHRASE_SUCCESS) { |
|
| 57 | - // Reset cached passphrase. |
|
| 58 | - $encryptionStore = EncryptionStore::getInstance(); |
|
| 59 | - withPHPSession(function () use ($encryptionStore) { |
|
| 60 | - $encryptionStore->add('smime', ''); |
|
| 61 | - }); |
|
| 62 | - } |
|
| 63 | - $response = [ |
|
| 64 | - 'type' => 3, |
|
| 65 | - 'code' => $data, |
|
| 66 | - ]; |
|
| 67 | - $this->addActionData('changepassphrase', $response); |
|
| 68 | - $GLOBALS['bus']->addData($this->getResponseData()); |
|
| 69 | - break; |
|
| 54 | + case 'changepassphrase': |
|
| 55 | + $data = $this->changePassphrase($actionData); |
|
| 56 | + if ($data === CHANGE_PASSPHRASE_SUCCESS) { |
|
| 57 | + // Reset cached passphrase. |
|
| 58 | + $encryptionStore = EncryptionStore::getInstance(); |
|
| 59 | + withPHPSession(function () use ($encryptionStore) { |
|
| 60 | + $encryptionStore->add('smime', ''); |
|
| 61 | + }); |
|
| 62 | + } |
|
| 63 | + $response = [ |
|
| 64 | + 'type' => 3, |
|
| 65 | + 'code' => $data, |
|
| 66 | + ]; |
|
| 67 | + $this->addActionData('changepassphrase', $response); |
|
| 68 | + $GLOBALS['bus']->addData($this->getResponseData()); |
|
| 69 | + break; |
|
| 70 | 70 | |
| 71 | - case 'list': |
|
| 72 | - $data = $this->getPublicCertificates(); |
|
| 73 | - $this->addActionData('list', $data); |
|
| 74 | - $GLOBALS['bus']->addData($this->getResponseData()); |
|
| 75 | - break; |
|
| 71 | + case 'list': |
|
| 72 | + $data = $this->getPublicCertificates(); |
|
| 73 | + $this->addActionData('list', $data); |
|
| 74 | + $GLOBALS['bus']->addData($this->getResponseData()); |
|
| 75 | + break; |
|
| 76 | 76 | |
| 77 | - case 'delete': |
|
| 78 | - // FIXME: handle multiple deletes? Separate function? |
|
| 79 | - $entryid = $actionData['entryid']; |
|
| 80 | - $root = mapi_msgstore_openentry($this->store); |
|
| 81 | - mapi_folder_deletemessages($root, [hex2bin($entryid)]); |
|
| 77 | + case 'delete': |
|
| 78 | + // FIXME: handle multiple deletes? Separate function? |
|
| 79 | + $entryid = $actionData['entryid']; |
|
| 80 | + $root = mapi_msgstore_openentry($this->store); |
|
| 81 | + mapi_folder_deletemessages($root, [hex2bin($entryid)]); |
|
| 82 | 82 | |
| 83 | - $this->sendFeedback(true); |
|
| 84 | - break; |
|
| 83 | + $this->sendFeedback(true); |
|
| 84 | + break; |
|
| 85 | 85 | |
| 86 | - default: |
|
| 87 | - $this->handleUnknownActionType($actionType); |
|
| 86 | + default: |
|
| 87 | + $this->handleUnknownActionType($actionType); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | catch (Exception $e) { |
@@ -33,14 +33,14 @@ |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | switch ($this->status) { |
| 36 | - case 'good': |
|
| 37 | - return OCSP_CERT_STATUS_GOOD; |
|
| 36 | + case 'good': |
|
| 37 | + return OCSP_CERT_STATUS_GOOD; |
|
| 38 | 38 | |
| 39 | - case 'revoked': |
|
| 40 | - return OCSP_CERT_STATUS_REVOKED; |
|
| 39 | + case 'revoked': |
|
| 40 | + return OCSP_CERT_STATUS_REVOKED; |
|
| 41 | 41 | |
| 42 | - default: |
|
| 43 | - return OCSP_CERT_STATUS_UNKOWN; |
|
| 42 | + default: |
|
| 43 | + return OCSP_CERT_STATUS_UNKOWN; |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -98,8 +98,9 @@ |
||
| 98 | 98 | // Get messages from certificates |
| 99 | 99 | foreach ($privateCerts as $privateCert) { |
| 100 | 100 | $privateCertMessage = mapi_msgstore_openentry($store, $privateCert[PR_ENTRYID]); |
| 101 | - if ($privateCertMessage === false) |
|
| 102 | - continue; |
|
| 101 | + if ($privateCertMessage === false) { |
|
| 102 | + continue; |
|
| 103 | + } |
|
| 103 | 104 | $pkcs12 = ""; |
| 104 | 105 | $certs = []; |
| 105 | 106 | // Read pkcs12 cert from message |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $abHierarchyRows = mapi_table_queryallrows($hierarchyTable, [PR_AB_PROVIDER_ID, PR_ENTRYID]); |
| 243 | 243 | |
| 244 | 244 | // Look for the 'Contacts Folders' |
| 245 | - for ($i = 0,$len = count($abHierarchyRows); $i < $len; ++$i) { |
|
| 245 | + for ($i = 0, $len = count($abHierarchyRows); $i < $len; ++$i) { |
|
| 246 | 246 | // Check if the folder matches the Contact Provider GUID |
| 247 | 247 | if ($abHierarchyRows[$i][PR_AB_PROVIDER_ID] == MUIDZCSAB) { |
| 248 | 248 | $abContactContainerEntryid = $abHierarchyRows[$i][PR_ENTRYID]; |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $abContactContainerHierarchyRows = mapi_table_queryallrows($abContactContainerHierarchyTable, [PR_DISPLAY_NAME, PR_OBJECT_TYPE, PR_ENTRYID]); |
| 259 | 259 | |
| 260 | 260 | // Loop through all the contact folders found under the 'Contacts Folders' hierarchy |
| 261 | - for ($j = 0,$len = count($abContactContainerHierarchyRows); $j < $len; ++$j) { |
|
| 261 | + for ($j = 0, $len = count($abContactContainerHierarchyRows); $j < $len; ++$j) { |
|
| 262 | 262 | // Open, get contents table, restrict, sort and then merge the result in the list of $rows |
| 263 | 263 | $abContactFolder = mapi_ab_openentry($ab, $abContactContainerHierarchyRows[$j][PR_ENTRYID]); |
| 264 | 264 | $abContactFolderTable = mapi_folder_getcontentstable($abContactFolder, MAPI_DEFERRED_ERRORS); |
@@ -507,12 +507,12 @@ |
||
| 507 | 507 | $data["search_meta"]["searchfolder_entryid"] = $entryid; |
| 508 | 508 | $data["search_meta"]["search_store_entryid"] = $action["store_entryid"]; |
| 509 | 509 | $data["search_meta"]["searchstate"] = $searchState; |
| 510 | - $data["search_meta"]["results"] = $numberOfResults; // actual number of items that we are sending to client |
|
| 510 | + $data["search_meta"]["results"] = $numberOfResults; // actual number of items that we are sending to client |
|
| 511 | 511 | |
| 512 | 512 | $data["page"] = []; |
| 513 | 513 | $data["page"]["start"] = 0; |
| 514 | 514 | $data["page"]["rowcount"] = $rowCount; |
| 515 | - $data["page"]["totalrowcount"] = $totalRowCount; // total number of items |
|
| 515 | + $data["page"]["totalrowcount"] = $totalRowCount; // total number of items |
|
| 516 | 516 | |
| 517 | 517 | if (!empty($listData)) { |
| 518 | 518 | $data["item"] = array_merge([], $listData); |
@@ -575,7 +575,7 @@ |
||
| 575 | 575 | ]; |
| 576 | 576 | |
| 577 | 577 | $rule[PR_RULE_NAME] = ''; |
| 578 | - $rule[PR_RULE_PROVIDER_DATA] = ''; // 0 byte binary string |
|
| 578 | + $rule[PR_RULE_PROVIDER_DATA] = ''; // 0 byte binary string |
|
| 579 | 579 | $rule[PR_RULE_STATE] = ST_ENABLED; |
| 580 | 580 | $rule[PR_RULE_LEVEL] = 0; |
| 581 | 581 | $rule[PR_RULE_SEQUENCE] = 0; |