@@ -49,39 +49,39 @@ |
||
| 49 | 49 | |
| 50 | 50 | case 'server.index.load.custom': |
| 51 | 51 | switch ($data['name']) { |
| 52 | - case 'files_get_recipients': |
|
| 53 | - RecipientHandler::doGetRecipients(); |
|
| 52 | + case 'files_get_recipients': |
|
| 53 | + RecipientHandler::doGetRecipients(); |
|
| 54 | 54 | |
| 55 | - break; |
|
| 55 | + break; |
|
| 56 | 56 | |
| 57 | - case 'download_file': |
|
| 58 | - DownloadHandler::doDownload(); |
|
| 57 | + case 'download_file': |
|
| 58 | + DownloadHandler::doDownload(); |
|
| 59 | 59 | |
| 60 | - break; |
|
| 60 | + break; |
|
| 61 | 61 | |
| 62 | - case 'upload_file': |
|
| 63 | - UploadHandler::doUpload(); |
|
| 62 | + case 'upload_file': |
|
| 63 | + UploadHandler::doUpload(); |
|
| 64 | 64 | |
| 65 | - break; |
|
| 65 | + break; |
|
| 66 | 66 | |
| 67 | - case 'form': |
|
| 68 | - if (isset($_GET['backend'])) { |
|
| 69 | - $backend = urldecode($_GET['backend']); |
|
| 70 | - } else { |
|
| 71 | - $backend = ''; |
|
| 72 | - } |
|
| 73 | - $backendstore = Files\Backend\BackendStore::getInstance(); |
|
| 67 | + case 'form': |
|
| 68 | + if (isset($_GET['backend'])) { |
|
| 69 | + $backend = urldecode($_GET['backend']); |
|
| 70 | + } else { |
|
| 71 | + $backend = ''; |
|
| 72 | + } |
|
| 73 | + $backendstore = Files\Backend\BackendStore::getInstance(); |
|
| 74 | 74 | |
| 75 | - if ($backendstore->backendExists($backend)) { |
|
| 76 | - $backendInstance = $backendstore->getInstanceOfBackend($backend); |
|
| 77 | - $formdata = $backendInstance->getFormConfig(); |
|
| 75 | + if ($backendstore->backendExists($backend)) { |
|
| 76 | + $backendInstance = $backendstore->getInstanceOfBackend($backend); |
|
| 77 | + $formdata = $backendInstance->getFormConfig(); |
|
| 78 | 78 | |
| 79 | - exit($formdata); |
|
| 80 | - } |
|
| 79 | + exit($formdata); |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - exit('Specified backend does not exist!'); |
|
| 82 | + exit('Specified backend does not exist!'); |
|
| 83 | 83 | |
| 84 | - break; |
|
| 84 | + break; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | break; |
@@ -420,8 +420,8 @@ |
||
| 420 | 420 | |
| 421 | 421 | private function certificateAsPem($cert) { |
| 422 | 422 | return "-----BEGIN CERTIFICATE-----\n" |
| 423 | - . chunk_split(base64_encode($cert['certificate_der'])) |
|
| 424 | - . '-----END CERTIFICATE-----'; |
|
| 423 | + . chunk_split(base64_encode($cert['certificate_der'])) |
|
| 424 | + . '-----END CERTIFICATE-----'; |
|
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |
@@ -34,14 +34,14 @@ |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | switch ($this->status) { |
| 37 | - case 'good': |
|
| 38 | - return OCSP_CERT_STATUS_GOOD; |
|
| 37 | + case 'good': |
|
| 38 | + return OCSP_CERT_STATUS_GOOD; |
|
| 39 | 39 | |
| 40 | - case 'revoked': |
|
| 41 | - return OCSP_CERT_STATUS_REVOKED; |
|
| 40 | + case 'revoked': |
|
| 41 | + return OCSP_CERT_STATUS_REVOKED; |
|
| 42 | 42 | |
| 43 | - default: |
|
| 44 | - return OCSP_CERT_STATUS_UNKOWN; |
|
| 43 | + default: |
|
| 44 | + return OCSP_CERT_STATUS_UNKOWN; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -215,18 +215,18 @@ discard block |
||
| 215 | 215 | $errorInfo = []; |
| 216 | 216 | |
| 217 | 217 | switch (mapi_last_hresult()) { |
| 218 | - case MAPI_E_NO_ACCESS: |
|
| 219 | - $errorInfo['error_message'] = _('Unable to perform search query, no permissions to create search folder.'); |
|
| 218 | + case MAPI_E_NO_ACCESS: |
|
| 219 | + $errorInfo['error_message'] = _('Unable to perform search query, no permissions to create search folder.'); |
|
| 220 | 220 | |
| 221 | - break; |
|
| 221 | + break; |
|
| 222 | 222 | |
| 223 | - case MAPI_E_NOT_FOUND: |
|
| 224 | - $errorInfo['error_message'] = _('Unable to perform search query, search folder not found.'); |
|
| 223 | + case MAPI_E_NOT_FOUND: |
|
| 224 | + $errorInfo['error_message'] = _('Unable to perform search query, search folder not found.'); |
|
| 225 | 225 | |
| 226 | - break; |
|
| 226 | + break; |
|
| 227 | 227 | |
| 228 | - default: |
|
| 229 | - $errorInfo['error_message'] = _('Unable to perform search query, store might not support searching.'); |
|
| 228 | + default: |
|
| 229 | + $errorInfo['error_message'] = _('Unable to perform search query, store might not support searching.'); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | $errorInfo['original_error_message'] = _('Error in creating search folder.'); |
@@ -381,45 +381,45 @@ discard block |
||
| 381 | 381 | $subres = $restriction[1]; |
| 382 | 382 | |
| 383 | 383 | switch ($subres[ULPROPTAG]) { |
| 384 | - case PR_SUBJECT: |
|
| 385 | - $patterns['subject'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 384 | + case PR_SUBJECT: |
|
| 385 | + $patterns['subject'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 386 | 386 | |
| 387 | - break; |
|
| 387 | + break; |
|
| 388 | 388 | |
| 389 | - case PR_BODY: |
|
| 390 | - $patterns['content'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 391 | - $patterns['attachments'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 389 | + case PR_BODY: |
|
| 390 | + $patterns['content'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 391 | + $patterns['attachments'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 392 | 392 | |
| 393 | - break; |
|
| 393 | + break; |
|
| 394 | 394 | |
| 395 | - case PR_SENDER_NAME: |
|
| 396 | - $patterns['sender'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 395 | + case PR_SENDER_NAME: |
|
| 396 | + $patterns['sender'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 397 | 397 | |
| 398 | - break; |
|
| 398 | + break; |
|
| 399 | 399 | |
| 400 | - case PR_SENT_REPRESENTING_NAME: |
|
| 401 | - $patterns['from'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 400 | + case PR_SENT_REPRESENTING_NAME: |
|
| 401 | + $patterns['from'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 402 | 402 | |
| 403 | - break; |
|
| 403 | + break; |
|
| 404 | 404 | |
| 405 | - case PR_DISPLAY_TO: |
|
| 406 | - case PR_DISPLAY_CC: |
|
| 407 | - $patterns['recipients'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 405 | + case PR_DISPLAY_TO: |
|
| 406 | + case PR_DISPLAY_CC: |
|
| 407 | + $patterns['recipients'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 408 | 408 | |
| 409 | - break; |
|
| 409 | + break; |
|
| 410 | 410 | |
| 411 | - case PR_MESSAGE_CLASS: |
|
| 412 | - if (empty($patterns['message_classes'])) { |
|
| 413 | - $patterns['message_classes'] = []; |
|
| 414 | - } |
|
| 415 | - $patterns['message_classes'][] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 411 | + case PR_MESSAGE_CLASS: |
|
| 412 | + if (empty($patterns['message_classes'])) { |
|
| 413 | + $patterns['message_classes'] = []; |
|
| 414 | + } |
|
| 415 | + $patterns['message_classes'][] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 416 | 416 | |
| 417 | - break; |
|
| 417 | + break; |
|
| 418 | 418 | |
| 419 | - case PR_DISPLAY_NAME: |
|
| 420 | - $patterns['others'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 419 | + case PR_DISPLAY_NAME: |
|
| 420 | + $patterns['others'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 421 | 421 | |
| 422 | - break; |
|
| 422 | + break; |
|
| 423 | 423 | } |
| 424 | 424 | } elseif (RES_AND == $type || RES_OR == $type) { |
| 425 | 425 | foreach ($restriction[1] as $subres) { |
@@ -270,18 +270,18 @@ |
||
| 270 | 270 | $errorInfo = []; |
| 271 | 271 | |
| 272 | 272 | switch (mapi_last_hresult()) { |
| 273 | - case MAPI_E_NO_ACCESS: |
|
| 274 | - $errorInfo['error_message'] = _('Unable to perform search query, no permissions to create search folder.'); |
|
| 273 | + case MAPI_E_NO_ACCESS: |
|
| 274 | + $errorInfo['error_message'] = _('Unable to perform search query, no permissions to create search folder.'); |
|
| 275 | 275 | |
| 276 | - break; |
|
| 276 | + break; |
|
| 277 | 277 | |
| 278 | - case MAPI_E_NOT_FOUND: |
|
| 279 | - $errorInfo['error_message'] = _('Unable to perform search query, search folder not found.'); |
|
| 278 | + case MAPI_E_NOT_FOUND: |
|
| 279 | + $errorInfo['error_message'] = _('Unable to perform search query, search folder not found.'); |
|
| 280 | 280 | |
| 281 | - break; |
|
| 281 | + break; |
|
| 282 | 282 | |
| 283 | - default: |
|
| 284 | - $errorInfo['error_message'] = _('Unable to perform search query, store might not support searching.'); |
|
| 283 | + default: |
|
| 284 | + $errorInfo['error_message'] = _('Unable to perform search query, store might not support searching.'); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | $errorInfo['original_error_message'] = _('Error in creating search folder.'); |
@@ -766,31 +766,31 @@ |
||
| 766 | 766 | |
| 767 | 767 | case '/': |
| 768 | 768 | if ('<' == $sToken) { |
| 769 | - $sToken .= $char; |
|
| 770 | - $bEndTag = true; |
|
| 771 | - } else { |
|
| 772 | - $content .= $char; |
|
| 773 | - } |
|
| 769 | + $sToken .= $char; |
|
| 770 | + $bEndTag = true; |
|
| 771 | + } else { |
|
| 772 | + $content .= $char; |
|
| 773 | + } |
|
| 774 | 774 | |
| 775 | - break; |
|
| 775 | + break; |
|
| 776 | 776 | |
| 777 | 777 | case '>': |
| 778 | 778 | if ($bEndTag) { |
| 779 | - $sToken .= $char; |
|
| 780 | - if (preg_match('/\<\/\s*style\s*\>/i', $sToken, $aMatch)) { |
|
| 781 | - $newpos = $i + 1; |
|
| 782 | - $bSucces = true; |
|
| 779 | + $sToken .= $char; |
|
| 780 | + if (preg_match('/\<\/\s*style\s*\>/i', $sToken, $aMatch)) { |
|
| 781 | + $newpos = $i + 1; |
|
| 782 | + $bSucces = true; |
|
| 783 | 783 | |
| 784 | - break 2; |
|
| 785 | - } |
|
| 786 | - $content .= $sToken; |
|
| 784 | + break 2; |
|
| 785 | + } |
|
| 786 | + $content .= $sToken; |
|
| 787 | 787 | |
| 788 | - $bEndTag = false; |
|
| 789 | - } else { |
|
| 790 | - $content .= $char; |
|
| 791 | - } |
|
| 788 | + $bEndTag = false; |
|
| 789 | + } else { |
|
| 790 | + $content .= $char; |
|
| 791 | + } |
|
| 792 | 792 | |
| 793 | - break; |
|
| 793 | + break; |
|
| 794 | 794 | |
| 795 | 795 | case '!': |
| 796 | 796 | if ('<' == $sToken) { |
@@ -717,14 +717,14 @@ |
||
| 717 | 717 | $this->userstores[$name] = $entryid; |
| 718 | 718 | } catch (MAPIException $e) { |
| 719 | 719 | error_log('Failed to open store. ' . $this->session_info['username'] . |
| 720 | - ' requested ' . bin2hex($entryid) . ($name ? " ({$name})" : '')); |
|
| 720 | + ' requested ' . bin2hex($entryid) . ($name ? " ({$name})" : '')); |
|
| 721 | 721 | |
| 722 | 722 | return $e->getCode(); |
| 723 | 723 | } catch (Exception $e) { |
| 724 | 724 | // mapi_openmsgstore seems to throw another exception than MAPIException |
| 725 | 725 | // sometimes, so we add a safety net. |
| 726 | 726 | error_log('Failed to open store. ' . $this->session_info['username'] . |
| 727 | - ' requested ' . bin2hex($entryid) . ($name ? " ({$name})" : '')); |
|
| 727 | + ' requested ' . bin2hex($entryid) . ($name ? " ({$name})" : '')); |
|
| 728 | 728 | |
| 729 | 729 | return $e->getCode(); |
| 730 | 730 | } |
@@ -353,44 +353,44 @@ |
||
| 353 | 353 | $result = true; |
| 354 | 354 | |
| 355 | 355 | switch ($loader) { |
| 356 | - case LOAD_RELEASE: |
|
| 357 | - if (!is_file(BASE_PATH . '/client/grommunio.js')) { |
|
| 358 | - $this->error('<strong>LOAD_RELEASE configured, but no release files found</strong>', $help_msg); |
|
| 359 | - $result = false; |
|
| 360 | - } elseif (is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 361 | - $this->error('<strong>LOAD_RELEASE configured, but source files were found</strong>', $help_msg); |
|
| 362 | - $result = false; |
|
| 363 | - } |
|
| 356 | + case LOAD_RELEASE: |
|
| 357 | + if (!is_file(BASE_PATH . '/client/grommunio.js')) { |
|
| 358 | + $this->error('<strong>LOAD_RELEASE configured, but no release files found</strong>', $help_msg); |
|
| 359 | + $result = false; |
|
| 360 | + } elseif (is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 361 | + $this->error('<strong>LOAD_RELEASE configured, but source files were found</strong>', $help_msg); |
|
| 362 | + $result = false; |
|
| 363 | + } |
|
| 364 | 364 | |
| 365 | - break; |
|
| 365 | + break; |
|
| 366 | 366 | |
| 367 | - case LOAD_DEBUG: |
|
| 368 | - if (!is_file(BASE_PATH . '/client/zarafa-debug.js')) { |
|
| 369 | - $this->error('<strong>LOAD_DEBUG configured, but no debug files found</strong>', $help_msg); |
|
| 370 | - $result = false; |
|
| 371 | - } elseif (is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 372 | - $this->error('<strong>LOAD_DEBUG configured, but source files were found</strong>', $help_msg); |
|
| 373 | - $result = false; |
|
| 374 | - } |
|
| 367 | + case LOAD_DEBUG: |
|
| 368 | + if (!is_file(BASE_PATH . '/client/zarafa-debug.js')) { |
|
| 369 | + $this->error('<strong>LOAD_DEBUG configured, but no debug files found</strong>', $help_msg); |
|
| 370 | + $result = false; |
|
| 371 | + } elseif (is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 372 | + $this->error('<strong>LOAD_DEBUG configured, but source files were found</strong>', $help_msg); |
|
| 373 | + $result = false; |
|
| 374 | + } |
|
| 375 | 375 | |
| 376 | - break; |
|
| 376 | + break; |
|
| 377 | 377 | |
| 378 | - case LOAD_SOURCE: |
|
| 379 | - if (!is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 380 | - $this->error('<strong>LOAD_SOURCE configured, but no source files found</strong>', $help_msg); |
|
| 381 | - $result = false; |
|
| 382 | - } elseif (is_file(BASE_PATH . '/client/grommunio.js') || is_file(BASE_PATH . '/client/zarafa-debug.js')) { |
|
| 383 | - $this->error('<strong>LOAD_SOURCE configured, but release & debug file were found</strong>', $help_msg); |
|
| 384 | - $result = false; |
|
| 385 | - } |
|
| 378 | + case LOAD_SOURCE: |
|
| 379 | + if (!is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 380 | + $this->error('<strong>LOAD_SOURCE configured, but no source files found</strong>', $help_msg); |
|
| 381 | + $result = false; |
|
| 382 | + } elseif (is_file(BASE_PATH . '/client/grommunio.js') || is_file(BASE_PATH . '/client/zarafa-debug.js')) { |
|
| 383 | + $this->error('<strong>LOAD_SOURCE configured, but release & debug file were found</strong>', $help_msg); |
|
| 384 | + $result = false; |
|
| 385 | + } |
|
| 386 | 386 | |
| 387 | - break; |
|
| 387 | + break; |
|
| 388 | 388 | |
| 389 | - default: |
|
| 390 | - $this->error('<strong>Unknown \'DEBUG_LOADER\' value: ' . $loader . '</strong>', $help_msg); |
|
| 391 | - $result = false; |
|
| 389 | + default: |
|
| 390 | + $this->error('<strong>Unknown \'DEBUG_LOADER\' value: ' . $loader . '</strong>', $help_msg); |
|
| 391 | + $result = false; |
|
| 392 | 392 | |
| 393 | - break; |
|
| 393 | + break; |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | return $result; |
@@ -662,23 +662,23 @@ |
||
| 662 | 662 | $props = mapi_getprops($store, [PR_DISPLAY_NAME]); |
| 663 | 663 | |
| 664 | 664 | switch ($e->getCode()) { |
| 665 | - case MAPI_E_NO_ACCESS: |
|
| 666 | - $msg = 'Unable to open FINDER_ROOT for store: %s.'; |
|
| 667 | - error_log(sprintf($msg, $props[PR_DISPLAY_NAME])); |
|
| 665 | + case MAPI_E_NO_ACCESS: |
|
| 666 | + $msg = 'Unable to open FINDER_ROOT for store: %s.'; |
|
| 667 | + error_log(sprintf($msg, $props[PR_DISPLAY_NAME])); |
|
| 668 | 668 | |
| 669 | - break; |
|
| 669 | + break; |
|
| 670 | 670 | |
| 671 | - case MAPI_E_NOT_FOUND: |
|
| 672 | - $msg = 'Unable to open FINDER_ROOT for store: %s. Folder not found.'; |
|
| 673 | - error_log(sprintf($msg, $props[PR_DISPLAY_NAME])); |
|
| 671 | + case MAPI_E_NOT_FOUND: |
|
| 672 | + $msg = 'Unable to open FINDER_ROOT for store: %s. Folder not found.'; |
|
| 673 | + error_log(sprintf($msg, $props[PR_DISPLAY_NAME])); |
|
| 674 | 674 | |
| 675 | - break; |
|
| 675 | + break; |
|
| 676 | 676 | |
| 677 | - default: |
|
| 678 | - $msg = 'Unable to open FINDER_ROOT for store: %s. Unknown MAPI Error %s.'; |
|
| 679 | - error_log(sprintf($msg, $props[PR_DISPLAY_NAME], get_mapi_error_name($e->getCode()))); |
|
| 677 | + default: |
|
| 678 | + $msg = 'Unable to open FINDER_ROOT for store: %s. Unknown MAPI Error %s.'; |
|
| 679 | + error_log(sprintf($msg, $props[PR_DISPLAY_NAME], get_mapi_error_name($e->getCode()))); |
|
| 680 | 680 | |
| 681 | - break; |
|
| 681 | + break; |
|
| 682 | 682 | } |
| 683 | 683 | } |
| 684 | 684 | } |