Test Failed
Push — master ( 6ab057...9e2699 )
by
unknown
23:26 queued 12:21
created
plugins/files/php/plugin.files.php 1 patch
Switch Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -45,37 +45,37 @@
 block discarded – undo
45 45
 
46 46
 			case 'server.index.load.custom':
47 47
 				switch ($data['name']) {
48
-				case 'files_get_recipients':
49
-					RecipientHandler::doGetRecipients();
50
-					break;
48
+					case 'files_get_recipients':
49
+						RecipientHandler::doGetRecipients();
50
+						break;
51 51
 
52
-				case 'download_file':
53
-					DownloadHandler::doDownload();
54
-					break;
52
+					case 'download_file':
53
+						DownloadHandler::doDownload();
54
+						break;
55 55
 
56
-				case 'upload_file':
57
-					UploadHandler::doUpload();
58
-					break;
56
+					case 'upload_file':
57
+						UploadHandler::doUpload();
58
+						break;
59 59
 
60
-				case 'form':
61
-					if (isset($_GET['backend'])) {
62
-						$backend = urldecode($_GET["backend"]);
63
-					}
64
-					else {
65
-						$backend = '';
66
-					}
67
-					$backendstore = Files\Backend\BackendStore::getInstance();
60
+					case 'form':
61
+						if (isset($_GET['backend'])) {
62
+							$backend = urldecode($_GET["backend"]);
63
+						}
64
+						else {
65
+							$backend = '';
66
+						}
67
+						$backendstore = Files\Backend\BackendStore::getInstance();
68 68
 
69
-					if ($backendstore->backendExists($backend)) {
70
-						$backendInstance = $backendstore->getInstanceOfBackend($backend);
71
-						$formdata = $backendInstance->getFormConfig();
69
+						if ($backendstore->backendExists($backend)) {
70
+							$backendInstance = $backendstore->getInstanceOfBackend($backend);
71
+							$formdata = $backendInstance->getFormConfig();
72 72
 
73
-						exit($formdata);
74
-					}
73
+							exit($formdata);
74
+						}
75 75
 
76
-						exit("Specified backend does not exist!");
76
+							exit("Specified backend does not exist!");
77 77
 
78
-					break;
78
+						break;
79 79
 			}
80 80
 			break;
81 81
 		}
Please login to merge, or discard this patch.
plugins/smime/php/lib/X509.php 1 patch
Switch Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -15,31 +15,31 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
plugins/smime/php/class.pluginsmimemodule.php 1 patch
Switch Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -29,62 +29,62 @@
 block discarded – undo
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, null);
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, null);
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) {
Please login to merge, or discard this patch.
plugins/smime/php/plugin.smime.php 1 patch
Switch Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -92,45 +92,45 @@  discard block
 block discarded – undo
92 92
 	public function execute($eventID, &$data) {
93 93
 		switch ($eventID) {
94 94
 		// Register plugin
95
-		case 'server.core.settings.init.before':
96
-			$this->onBeforeSettingsInit($data);
97
-			break;
98
-		// Verify a signed or encrypted message when an email is opened
99
-		case 'server.util.parse_smime.signed':
100
-			$this->onSignedMessage($data);
101
-			break;
102
-
103
-		case 'server.util.parse_smime.encrypted':
104
-			$this->onEncrypted($data);
105
-			break;
106
-		// Add S/MIME property, which is send to the client
107
-		case 'server.module.itemmodule.open.after':
108
-			$this->onAfterOpen($data);
109
-			break;
110
-		// Catch uploaded certificate
111
-		case 'server.upload_attachment.upload':
112
-			$this->onUploadCertificate($data);
113
-			break;
114
-		// Sign email before sending
115
-		case 'server.core.operations.submitmessage':
116
-			$this->onBeforeSend($data);
117
-			break;
118
-		// Verify that we have public certificates for all recipients
119
-		case 'server.module.createmailitemmodule.beforesend':
120
-			$this->onCertificateCheck($data);
121
-			break;
122
-
123
-		case 'server.index.load.custom':
124
-			if ($data['name'] === 'smime_passphrase') {
125
-				include 'templates/passphrase.tpl.php';
126
-				exit();
127
-			}
128
-			if ($data['name'] === 'smime_passphrasecheck') {
129
-				// No need to do anything, this is just used to trigger
130
-				// the browser's autofill save password dialog.
131
-				exit();
132
-			}
133
-			break;
95
+			case 'server.core.settings.init.before':
96
+				$this->onBeforeSettingsInit($data);
97
+				break;
98
+			// Verify a signed or encrypted message when an email is opened
99
+			case 'server.util.parse_smime.signed':
100
+				$this->onSignedMessage($data);
101
+				break;
102
+
103
+			case 'server.util.parse_smime.encrypted':
104
+				$this->onEncrypted($data);
105
+				break;
106
+			// Add S/MIME property, which is send to the client
107
+			case 'server.module.itemmodule.open.after':
108
+				$this->onAfterOpen($data);
109
+				break;
110
+			// Catch uploaded certificate
111
+			case 'server.upload_attachment.upload':
112
+				$this->onUploadCertificate($data);
113
+				break;
114
+			// Sign email before sending
115
+			case 'server.core.operations.submitmessage':
116
+				$this->onBeforeSend($data);
117
+				break;
118
+			// Verify that we have public certificates for all recipients
119
+			case 'server.module.createmailitemmodule.beforesend':
120
+				$this->onCertificateCheck($data);
121
+				break;
122
+
123
+			case 'server.index.load.custom':
124
+				if ($data['name'] === 'smime_passphrase') {
125
+					include 'templates/passphrase.tpl.php';
126
+					exit();
127
+				}
128
+				if ($data['name'] === 'smime_passphrasecheck') {
129
+					// No need to do anything, this is just used to trigger
130
+					// the browser's autofill save password dialog.
131
+					exit();
132
+				}
133
+				break;
134 134
 		}
135 135
 	}
136 136
 
@@ -663,23 +663,23 @@  discard block
 block discarded – undo
663 663
 
664 664
 		// Sign then Encrypt email
665 665
 		switch ($messageClass) {
666
-		case 'IPM.Note.deferSMIME.SignedEncrypt':
667
-		case 'IPM.Note.SMIME.SignedEncrypt':
668
-			$tmpFile = tempnam(sys_get_temp_dir(), true);
669
-			$this->sign($tmpSendEmail, $tmpFile, $message, $signedAttach, $smimeProps);
670
-			$this->encrypt($tmpFile, $tmpSendSmimeEmail, $message, $signedAttach, $smimeProps);
671
-			unlink($tmpFile);
672
-			break;
673
-
674
-		case 'IPM.Note.deferSMIME.MultipartSigned':
675
-		case 'IPM.Note.SMIME.MultipartSigned':
676
-			$this->sign($tmpSendEmail, $tmpSendSmimeEmail, $message, $signedAttach, $smimeProps);
677
-			break;
678
-
679
-		case 'IPM.Note.deferSMIME':
680
-		case 'IPM.Note.SMIME':
681
-			$this->encrypt($tmpSendEmail, $tmpSendSmimeEmail, $message, $signedAttach, $smimeProps);
682
-			break;
666
+			case 'IPM.Note.deferSMIME.SignedEncrypt':
667
+			case 'IPM.Note.SMIME.SignedEncrypt':
668
+				$tmpFile = tempnam(sys_get_temp_dir(), true);
669
+				$this->sign($tmpSendEmail, $tmpFile, $message, $signedAttach, $smimeProps);
670
+				$this->encrypt($tmpFile, $tmpSendSmimeEmail, $message, $signedAttach, $smimeProps);
671
+				unlink($tmpFile);
672
+				break;
673
+
674
+			case 'IPM.Note.deferSMIME.MultipartSigned':
675
+			case 'IPM.Note.SMIME.MultipartSigned':
676
+				$this->sign($tmpSendEmail, $tmpSendSmimeEmail, $message, $signedAttach, $smimeProps);
677
+				break;
678
+
679
+			case 'IPM.Note.deferSMIME':
680
+			case 'IPM.Note.SMIME':
681
+				$this->encrypt($tmpSendEmail, $tmpSendSmimeEmail, $message, $signedAttach, $smimeProps);
682
+				break;
683 683
 		}
684 684
 
685 685
 		// Save the signed message as attachment of the send email
Please login to merge, or discard this patch.
plugins/smime/php/class.certificate.php 1 patch
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
server/includes/modules/class.itemmodule.php 1 patch
Switch Indentation   +177 added lines, -177 removed lines patch added patch discarded remove patch
@@ -50,240 +50,240 @@
 block discarded – undo
50 50
 					$entryid = $this->getActionEntryID($action);
51 51
 
52 52
 					switch ($actionType) {
53
-					case "open":
54
-						$this->open($store, $entryid, $action);
55
-						break;
53
+						case "open":
54
+							$this->open($store, $entryid, $action);
55
+							break;
56 56
 
57
-					case "save":
58
-						if (!$store || !$parententryid) {
59
-							/*
57
+						case "save":
58
+							if (!$store || !$parententryid) {
59
+								/*
60 60
 							 * if parententryid or storeentryid is not passed then we can take a guess that
61 61
 							 * it would be  a save operation but instead of depending on server to get default
62 62
 							 * parent and store client should always send parententryid and storeentryid
63 63
 							 *
64 64
 							 * we can also assume that user has permission to right in his own store
65 65
 							 */
66
-							$this->save($store, $parententryid, $entryid, $action);
67
-							break;
68
-						}
69
-						/*
66
+								$this->save($store, $parententryid, $entryid, $action);
67
+								break;
68
+							}
69
+							/*
70 70
 						 * The "message_action" object has been set, check the action_type field for
71 71
 						 * the exact action which must be taken.
72 72
 						 * Supported actions:
73 73
 						 *   - acceptmeetingrequest: attendee has accepted mr
74 74
 						 *   - declineMeetingRequest: attendee has declined mr
75 75
 						 */
76
-						if (!isset($action["message_action"], $action["message_action"]["action_type"])) {
77
-							$this->save($store, $parententryid, $entryid, $action);
78
-							break;
79
-						}
80
-						switch ($action["message_action"]["action_type"]) {
81
-						case "declineMeetingRequest":
82
-						case "acceptMeetingRequest":
83
-							$message = $GLOBALS["operations"]->openMessage($store, $entryid);
84
-							$basedate = (isset($action['basedate']) ? $action['basedate'] : false);
85
-							$delete = false;
86
-
87
-							if ($basedate) {
88
-								$recurrence = new Recurrence($store, $message);
89
-								$exceptionatt = $recurrence->getExceptionAttachment($basedate);
90
-								if ($exceptionatt) {
91
-									// get properties of existing exception.
92
-									$exceptionattProps = mapi_getprops($exceptionatt, [PR_ATTACH_NUM]);
93
-									$attach_num = $exceptionattProps[PR_ATTACH_NUM];
94
-								}
76
+							if (!isset($action["message_action"], $action["message_action"]["action_type"])) {
77
+								$this->save($store, $parententryid, $entryid, $action);
78
+								break;
95 79
 							}
80
+							switch ($action["message_action"]["action_type"]) {
81
+								case "declineMeetingRequest":
82
+								case "acceptMeetingRequest":
83
+									$message = $GLOBALS["operations"]->openMessage($store, $entryid);
84
+									$basedate = (isset($action['basedate']) ? $action['basedate'] : false);
85
+									$delete = false;
86
+
87
+									if ($basedate) {
88
+										$recurrence = new Recurrence($store, $message);
89
+										$exceptionatt = $recurrence->getExceptionAttachment($basedate);
90
+										if ($exceptionatt) {
91
+											// get properties of existing exception.
92
+											$exceptionattProps = mapi_getprops($exceptionatt, [PR_ATTACH_NUM]);
93
+											$attach_num = $exceptionattProps[PR_ATTACH_NUM];
94
+										}
95
+									}
96 96
 
97
-							/**
97
+									/**
98 98
 							 * Get message class from original message. This can be changed to
99 99
 							 * IPM.Appointment if the item is a Meeting Request in the maillist.
100 100
 							 * After Accepting/Declining the message is moved and changed.
101 101
 							 */
102
-							$originalMessageProps = mapi_getprops($message, [PR_MESSAGE_CLASS]);
103
-							$req = new Meetingrequest($store, $message, $GLOBALS["mapisession"]->getSession(), $this->directBookingMeetingRequest);
102
+									$originalMessageProps = mapi_getprops($message, [PR_MESSAGE_CLASS]);
103
+									$req = new Meetingrequest($store, $message, $GLOBALS["mapisession"]->getSession(), $this->directBookingMeetingRequest);
104 104
 
105
-							// Update extra body information
106
-							if (isset($action["message_action"]['meetingTimeInfo']) && !empty($action["message_action"]['meetingTimeInfo'])) {
107
-								$req->setMeetingTimeInfo($action["message_action"]['meetingTimeInfo']);
108
-								unset($action["message_action"]['meetingTimeInfo']);
109
-							}
105
+									// Update extra body information
106
+									if (isset($action["message_action"]['meetingTimeInfo']) && !empty($action["message_action"]['meetingTimeInfo'])) {
107
+										$req->setMeetingTimeInfo($action["message_action"]['meetingTimeInfo']);
108
+										unset($action["message_action"]['meetingTimeInfo']);
109
+									}
110 110
 
111
-							// sendResponse flag if it is set then send the mail response to the organzer.
112
-							$sendResponse = true;
113
-							if (isset($action["message_action"]["sendResponse"]) && $action["message_action"]["sendResponse"] == false) {
114
-								$sendResponse = false;
115
-							}
111
+									// sendResponse flag if it is set then send the mail response to the organzer.
112
+									$sendResponse = true;
113
+									if (isset($action["message_action"]["sendResponse"]) && $action["message_action"]["sendResponse"] == false) {
114
+										$sendResponse = false;
115
+									}
116 116
 
117
-							// @FIXME: fix body
118
-							$body = false;
119
-							if (isset($action["props"]["isHTML"]) && $action["props"]["isHTML"] === true) {
120
-								$body = isset($action["props"]["html_body"]) ? $action["props"]["html_body"] : false;
121
-							}
122
-							else {
123
-								$body = isset($action["props"]["body"]) ? $action["props"]["body"] : false;
124
-							}
117
+									// @FIXME: fix body
118
+									$body = false;
119
+									if (isset($action["props"]["isHTML"]) && $action["props"]["isHTML"] === true) {
120
+										$body = isset($action["props"]["html_body"]) ? $action["props"]["html_body"] : false;
121
+									}
122
+									else {
123
+										$body = isset($action["props"]["body"]) ? $action["props"]["body"] : false;
124
+									}
125 125
 
126
-							if ($action["message_action"]["action_type"] == "acceptMeetingRequest") {
127
-								$tentative = $action["message_action"]["responseType"] === olResponseTentative;
128
-								$newProposedStartTime = isset($action["message_action"]["proposed_starttime"]) ? $action["message_action"]["proposed_starttime"] : false;
129
-								$newProposedEndTime = isset($action["message_action"]["proposed_endtime"]) ? $action["message_action"]["proposed_endtime"] : false;
126
+									if ($action["message_action"]["action_type"] == "acceptMeetingRequest") {
127
+										$tentative = $action["message_action"]["responseType"] === olResponseTentative;
128
+										$newProposedStartTime = isset($action["message_action"]["proposed_starttime"]) ? $action["message_action"]["proposed_starttime"] : false;
129
+										$newProposedEndTime = isset($action["message_action"]["proposed_endtime"]) ? $action["message_action"]["proposed_endtime"] : false;
130 130
 
131
-								// We are accepting MR from preview-read-mail so set delete the actual mail flag.
132
-								$delete = $req->isMeetingRequest($originalMessageProps[PR_MESSAGE_CLASS]);
131
+										// We are accepting MR from preview-read-mail so set delete the actual mail flag.
132
+										$delete = $req->isMeetingRequest($originalMessageProps[PR_MESSAGE_CLASS]);
133 133
 
134
-								$req->doAccept($tentative, $sendResponse, $delete, $newProposedStartTime, $newProposedEndTime, $body, true, $store, $basedate);
135
-							}
136
-							else {
137
-								$delete = $req->doDecline($sendResponse, $basedate, $body);
138
-							}
134
+										$req->doAccept($tentative, $sendResponse, $delete, $newProposedStartTime, $newProposedEndTime, $body, true, $store, $basedate);
135
+									}
136
+									else {
137
+										$delete = $req->doDecline($sendResponse, $basedate, $body);
138
+									}
139 139
 
140
-							/**
140
+									/**
141 141
 							 * Now if the item is the Meeting Request that was sent to the attendee
142 142
 							 * it is removed when the user has clicked on Accept/Decline. If the
143 143
 							 * item is the appointment in the calendar it will not be moved. To only
144 144
 							 * notify the bus when the item is a Meeting Request we are going to
145 145
 							 * check the PR_MESSAGE_CLASS and see if it is "IPM.Meeting*".
146 146
 							 */
147
-							$messageProps = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]);
147
+									$messageProps = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]);
148 148
 
149
-							// if opened appointment is exception then it will add
150
-							// the attach_num and basedate in messageProps.
151
-							if (isset($attach_num)) {
152
-								$messageProps[PR_ATTACH_NUM] = [$attach_num];
153
-								$messageProps[$properties["basedate"]] = $basedate;
154
-							}
149
+									// if opened appointment is exception then it will add
150
+									// the attach_num and basedate in messageProps.
151
+									if (isset($attach_num)) {
152
+										$messageProps[PR_ATTACH_NUM] = [$attach_num];
153
+										$messageProps[$properties["basedate"]] = $basedate;
154
+									}
155 155
 
156
-							if ($delete) {
157
-								// send TABLE_DELETE event because the message has moved
158
-								$this->sendFeedback(true);
159
-								$GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), TABLE_DELETE, $messageProps);
160
-							}
161
-							else {
162
-								$this->addActionData("update", ["item" => Conversion::mapMAPI2XML($this->properties, $messageProps)]);
163
-								$GLOBALS["bus"]->addData($this->getResponseData());
156
+									if ($delete) {
157
+										// send TABLE_DELETE event because the message has moved
158
+										$this->sendFeedback(true);
159
+										$GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), TABLE_DELETE, $messageProps);
160
+									}
161
+									else {
162
+										$this->addActionData("update", ["item" => Conversion::mapMAPI2XML($this->properties, $messageProps)]);
163
+										$GLOBALS["bus"]->addData($this->getResponseData());
164 164
 
165
-								// send TABLE_SAVE event because an occurrence is deleted
166
-								$GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), TABLE_SAVE, $messageProps);
167
-							}
165
+										// send TABLE_SAVE event because an occurrence is deleted
166
+										$GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), TABLE_SAVE, $messageProps);
167
+									}
168 168
 
169
-							break;
169
+									break;
170 170
 
171
-						case "acceptTaskRequest":
172
-						case "declineTaskRequest":
173
-							$message = $GLOBALS["operations"]->openMessage($store, $entryid);
171
+								case "acceptTaskRequest":
172
+								case "declineTaskRequest":
173
+									$message = $GLOBALS["operations"]->openMessage($store, $entryid);
174 174
 
175
-							if (isset($action["props"]) && !empty($action["props"])) {
176
-								$properties = $GLOBALS["properties"]->getTaskProperties();
177
-								mapi_setprops($message, Conversion::mapXML2MAPI($properties, $action["props"]));
178
-								mapi_savechanges($message);
179
-							}
180
-							// The task may be a delegated task, do an update if needed (will fail for non-delegated tasks)
181
-							$tr = new TaskRequest($store, $message, $GLOBALS["mapisession"]->getSession());
182
-							$isAccept = $action["message_action"]["action_type"] == "acceptTaskRequest";
183
-							if (isset($action["message_action"]["task_comments_info"]) && !empty($action["message_action"]["task_comments_info"])) {
184
-								$tr->setTaskCommentsInfo($action["message_action"]["task_comments_info"]);
185
-							}
186
-							if ($isAccept) {
187
-								$result = $tr->doAccept();
188
-							}
189
-							else {
190
-								$result = $tr->doDecline();
191
-							}
175
+									if (isset($action["props"]) && !empty($action["props"])) {
176
+										$properties = $GLOBALS["properties"]->getTaskProperties();
177
+										mapi_setprops($message, Conversion::mapXML2MAPI($properties, $action["props"]));
178
+										mapi_savechanges($message);
179
+									}
180
+									// The task may be a delegated task, do an update if needed (will fail for non-delegated tasks)
181
+									$tr = new TaskRequest($store, $message, $GLOBALS["mapisession"]->getSession());
182
+									$isAccept = $action["message_action"]["action_type"] == "acceptTaskRequest";
183
+									if (isset($action["message_action"]["task_comments_info"]) && !empty($action["message_action"]["task_comments_info"])) {
184
+										$tr->setTaskCommentsInfo($action["message_action"]["task_comments_info"]);
185
+									}
186
+									if ($isAccept) {
187
+										$result = $tr->doAccept();
188
+									}
189
+									else {
190
+										$result = $tr->doDecline();
191
+									}
192 192
 
193
-							$this->sendFeedback(true);
194
-							if ($result !== false) {
195
-								$GLOBALS["bus"]->notify(bin2hex($result[PR_PARENT_ENTRYID]), TABLE_DELETE, $result);
196
-							}
193
+									$this->sendFeedback(true);
194
+									if ($result !== false) {
195
+										$GLOBALS["bus"]->notify(bin2hex($result[PR_PARENT_ENTRYID]), TABLE_DELETE, $result);
196
+									}
197 197
 
198
-							$props = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]);
199
-							if (!$tr->isTaskRequest()) {
200
-								unset($props[PR_MESSAGE_CLASS]);
201
-								$GLOBALS["bus"]->notify(bin2hex($props[PR_PARENT_ENTRYID]), $isAccept ? TABLE_SAVE : TABLE_DELETE, $props);
198
+									$props = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]);
199
+									if (!$tr->isTaskRequest()) {
200
+										unset($props[PR_MESSAGE_CLASS]);
201
+										$GLOBALS["bus"]->notify(bin2hex($props[PR_PARENT_ENTRYID]), $isAccept ? TABLE_SAVE : TABLE_DELETE, $props);
202
+									}
203
+									break;
204
+
205
+								case "copy":
206
+								case "move":
207
+									$this->copy($store, $parententryid, $entryid, $action);
208
+									break;
209
+
210
+								case "reply":
211
+								case "replyall":
212
+								case "forward":
213
+								default:
214
+									$this->save($store, $parententryid, $entryid, $action);
202 215
 							}
203
-							break;
204
-
205
-						case "copy":
206
-						case "move":
207
-							$this->copy($store, $parententryid, $entryid, $action);
208
-							break;
209
-
210
-						case "reply":
211
-						case "replyall":
212
-						case "forward":
213
-						default:
214
-							$this->save($store, $parententryid, $entryid, $action);
215
-						}
216 216
 						break;
217 217
 
218
-					case "delete":
219
-						$subActionType = false;
220
-						if (isset($action["message_action"], $action["message_action"]["action_type"])) {
221
-							$subActionType = $action["message_action"]["action_type"];
222
-						}
218
+						case "delete":
219
+							$subActionType = false;
220
+							if (isset($action["message_action"], $action["message_action"]["action_type"])) {
221
+								$subActionType = $action["message_action"]["action_type"];
222
+							}
223 223
 
224
-						/*
224
+							/*
225 225
 						 * The "message_action" object has been set, check the action_type field for
226 226
 						 * the exact action which must be taken.
227 227
 						 * Supported actions:
228 228
 						 *   - cancelInvitation: organizer cancels already scheduled meeting
229 229
 						 *   - removeFromCalendar: attendee receives meeting cancellation and wants to remove item from calendar
230 230
 						 */
231
-						switch ($subActionType) {
232
-						case "removeFromCalendar":
233
-							$basedate = (isset($action['basedate']) && !empty($action['basedate'])) ? $action['basedate'] : false;
234
-
235
-							$this->removeFromCalendar($store, $entryid, $basedate, $this->directBookingMeetingRequest);
236
-							$this->sendFeedback(true);
237
-							break;
238
-
239
-						case "cancelInvitation":
240
-							$this->cancelInvitation($store, $entryid, $action, $this->directBookingMeetingRequest);
241
-							$this->sendFeedback(true);
242
-							break;
243
-
244
-						case "declineMeeting":
245
-							// @FIXME can we somehow merge declineMeeting and declineMeetingRequest sub actions?
246
-							$message = $GLOBALS["operations"]->openMessage($store, $entryid);
247
-							$basedate = (isset($action['basedate']) && !empty($action['basedate'])) ? $action['basedate'] : false;
248
-
249
-							$req = new Meetingrequest($store, $message, $GLOBALS["mapisession"]->getSession(), $this->directBookingMeetingRequest);
250
-
251
-							// @FIXME: may be we can remove this body check any get it while declining meeting 'body'
252
-							$body = false;
253
-							if (isset($action["props"]["isHTML"]) && $action["props"]["isHTML"] === true) {
254
-								$body = isset($action["props"]["html_body"]) ? $action["props"]["html_body"] : false;
255
-							}
256
-							else {
257
-								$body = isset($action["props"]["body"]) ? $action["props"]["body"] : false;
258
-							}
259
-							$req->doDecline(true, $basedate, $body);
231
+							switch ($subActionType) {
232
+								case "removeFromCalendar":
233
+									$basedate = (isset($action['basedate']) && !empty($action['basedate'])) ? $action['basedate'] : false;
234
+
235
+									$this->removeFromCalendar($store, $entryid, $basedate, $this->directBookingMeetingRequest);
236
+									$this->sendFeedback(true);
237
+									break;
238
+
239
+								case "cancelInvitation":
240
+									$this->cancelInvitation($store, $entryid, $action, $this->directBookingMeetingRequest);
241
+									$this->sendFeedback(true);
242
+									break;
243
+
244
+								case "declineMeeting":
245
+									// @FIXME can we somehow merge declineMeeting and declineMeetingRequest sub actions?
246
+									$message = $GLOBALS["operations"]->openMessage($store, $entryid);
247
+									$basedate = (isset($action['basedate']) && !empty($action['basedate'])) ? $action['basedate'] : false;
248
+
249
+									$req = new Meetingrequest($store, $message, $GLOBALS["mapisession"]->getSession(), $this->directBookingMeetingRequest);
250
+
251
+									// @FIXME: may be we can remove this body check any get it while declining meeting 'body'
252
+									$body = false;
253
+									if (isset($action["props"]["isHTML"]) && $action["props"]["isHTML"] === true) {
254
+										$body = isset($action["props"]["html_body"]) ? $action["props"]["html_body"] : false;
255
+									}
256
+									else {
257
+										$body = isset($action["props"]["body"]) ? $action["props"]["body"] : false;
258
+									}
259
+									$req->doDecline(true, $basedate, $body);
260 260
 
261
-							$messageProps = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]);
262
-							$GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), $basedate ? TABLE_SAVE : TABLE_DELETE, $messageProps);
261
+									$messageProps = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]);
262
+									$GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), $basedate ? TABLE_SAVE : TABLE_DELETE, $messageProps);
263 263
 
264
-							break;
264
+									break;
265 265
 
266
-						case "snooze":
267
-						case "dismiss":
268
-							$this->delete($store, $parententryid, $entryid, $action);
269
-							break;
266
+								case "snooze":
267
+								case "dismiss":
268
+									$this->delete($store, $parententryid, $entryid, $action);
269
+									break;
270 270
 
271
-						default:
272
-							// Deleting an occurrence means that we have to save the message to
273
-							// generate an exception. So when the basedate is provided, we actually
274
-							// perform a save rather then delete.
275
-							if (isset($action['basedate']) && !empty($action['basedate'])) {
276
-								$this->save($store, $parententryid, $entryid, $action, "delete");
277
-							}
278
-							else {
279
-								$this->delete($store, $parententryid, $entryid, $action);
271
+								default:
272
+									// Deleting an occurrence means that we have to save the message to
273
+									// generate an exception. So when the basedate is provided, we actually
274
+									// perform a save rather then delete.
275
+									if (isset($action['basedate']) && !empty($action['basedate'])) {
276
+										$this->save($store, $parententryid, $entryid, $action, "delete");
277
+									}
278
+									else {
279
+										$this->delete($store, $parententryid, $entryid, $action);
280
+									}
281
+									break;
280 282
 							}
281
-							break;
282
-						}
283 283
 						break;
284 284
 
285
-					default:
286
-						$this->handleUnknownActionType($actionType);
285
+						default:
286
+							$this->handleUnknownActionType($actionType);
287 287
 					}
288 288
 				}
289 289
 				catch (MAPIException $e) {
Please login to merge, or discard this patch.
server/includes/core/class.operations.php 1 patch
Switch Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -2844,68 +2844,68 @@
 block discarded – undo
2844 2844
 			$msgprops = mapi_getprops($store, [PR_IPM_WASTEBASKET_ENTRYID, PR_MDB_PROVIDER, PR_IPM_OUTBOX_ENTRYID]);
2845 2845
 
2846 2846
 			switch ($msgprops[PR_MDB_PROVIDER]) {
2847
-			case ZARAFA_STORE_DELEGATE_GUID:
2848
-				$softDelete = $softDelete || defined('ENABLE_DEFAULT_SOFT_DELETE') ? ENABLE_DEFAULT_SOFT_DELETE : false;
2849
-				// with a store from an other user we need our own waste basket...
2850
-				if (isset($msgprops[PR_IPM_WASTEBASKET_ENTRYID]) && $msgprops[PR_IPM_WASTEBASKET_ENTRYID] == $parententryid || $softDelete) {
2851
-					// except when it is the waste basket itself
2852
-					$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2853
-					break;
2854
-				}
2855
-				$defaultstore = $GLOBALS["mapisession"]->getDefaultMessageStore();
2856
-				$msgprops = mapi_getprops($defaultstore, [PR_IPM_WASTEBASKET_ENTRYID, PR_MDB_PROVIDER]);
2847
+				case ZARAFA_STORE_DELEGATE_GUID:
2848
+					$softDelete = $softDelete || defined('ENABLE_DEFAULT_SOFT_DELETE') ? ENABLE_DEFAULT_SOFT_DELETE : false;
2849
+					// with a store from an other user we need our own waste basket...
2850
+					if (isset($msgprops[PR_IPM_WASTEBASKET_ENTRYID]) && $msgprops[PR_IPM_WASTEBASKET_ENTRYID] == $parententryid || $softDelete) {
2851
+						// except when it is the waste basket itself
2852
+						$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2853
+						break;
2854
+					}
2855
+					$defaultstore = $GLOBALS["mapisession"]->getDefaultMessageStore();
2856
+					$msgprops = mapi_getprops($defaultstore, [PR_IPM_WASTEBASKET_ENTRYID, PR_MDB_PROVIDER]);
2857 2857
 
2858
-				if (!isset($msgprops[PR_IPM_WASTEBASKET_ENTRYID]) ||
2859
-				    $msgprops[PR_IPM_WASTEBASKET_ENTRYID] == $parententryid) {
2860
-					$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2858
+					if (!isset($msgprops[PR_IPM_WASTEBASKET_ENTRYID]) ||
2859
+				    	$msgprops[PR_IPM_WASTEBASKET_ENTRYID] == $parententryid) {
2860
+						$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2861
+						break;
2862
+					}
2863
+					try {
2864
+						$result = $this->copyMessages($store, $parententryid, $defaultstore, $msgprops[PR_IPM_WASTEBASKET_ENTRYID], $entryids, [], true);
2865
+					}
2866
+					catch (MAPIException $e) {
2867
+						$e->setHandled();
2868
+						// if moving fails, try normal delete
2869
+						$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2870
+					}
2861 2871
 					break;
2862
-				}
2863
-				try {
2864
-					$result = $this->copyMessages($store, $parententryid, $defaultstore, $msgprops[PR_IPM_WASTEBASKET_ENTRYID], $entryids, [], true);
2865
-				}
2866
-				catch (MAPIException $e) {
2867
-					$e->setHandled();
2868
-					// if moving fails, try normal delete
2869
-					$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2870
-				}
2871
-				break;
2872 2872
 
2873
-			case ZARAFA_STORE_ARCHIVER_GUID:
2874
-			case ZARAFA_STORE_PUBLIC_GUID:
2875
-				// always delete in public store and archive store
2876
-				$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2877
-				break;
2878
-
2879
-			case ZARAFA_SERVICE_GUID:
2880
-				// delete message when in your own waste basket, else move it to the waste basket
2881
-				if (isset($msgprops[PR_IPM_WASTEBASKET_ENTRYID]) && $msgprops[PR_IPM_WASTEBASKET_ENTRYID] == $parententryid || $softDelete == true) {
2873
+				case ZARAFA_STORE_ARCHIVER_GUID:
2874
+				case ZARAFA_STORE_PUBLIC_GUID:
2875
+					// always delete in public store and archive store
2882 2876
 					$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2883 2877
 					break;
2884
-				}
2885
-				try {
2886
-					// if the message is deleting from outbox then first delete the
2887
-					// message from an outgoing queue.
2888
-					if (function_exists("mapi_msgstore_abortsubmit") && isset($msgprops[PR_IPM_OUTBOX_ENTRYID]) && $msgprops[PR_IPM_OUTBOX_ENTRYID] === $parententryid) {
2889
-						foreach ($entryids as $entryid) {
2890
-							$message = mapi_msgstore_openentry($store, $entryid);
2891
-							$messageProps = mapi_getprops($message, [PR_DEFERRED_SEND_TIME]);
2892
-							if (isset($messageProps[PR_DEFERRED_SEND_TIME])) {
2893
-								mapi_msgstore_abortsubmit($store, $entryid);
2878
+
2879
+				case ZARAFA_SERVICE_GUID:
2880
+					// delete message when in your own waste basket, else move it to the waste basket
2881
+					if (isset($msgprops[PR_IPM_WASTEBASKET_ENTRYID]) && $msgprops[PR_IPM_WASTEBASKET_ENTRYID] == $parententryid || $softDelete == true) {
2882
+						$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2883
+						break;
2884
+					}
2885
+					try {
2886
+						// if the message is deleting from outbox then first delete the
2887
+						// message from an outgoing queue.
2888
+						if (function_exists("mapi_msgstore_abortsubmit") && isset($msgprops[PR_IPM_OUTBOX_ENTRYID]) && $msgprops[PR_IPM_OUTBOX_ENTRYID] === $parententryid) {
2889
+							foreach ($entryids as $entryid) {
2890
+								$message = mapi_msgstore_openentry($store, $entryid);
2891
+								$messageProps = mapi_getprops($message, [PR_DEFERRED_SEND_TIME]);
2892
+								if (isset($messageProps[PR_DEFERRED_SEND_TIME])) {
2893
+									mapi_msgstore_abortsubmit($store, $entryid);
2894
+								}
2894 2895
 							}
2895 2896
 						}
2897
+						$result = $this->copyMessages($store, $parententryid, $store, $msgprops[PR_IPM_WASTEBASKET_ENTRYID], $entryids, [], true);
2896 2898
 					}
2897
-					$result = $this->copyMessages($store, $parententryid, $store, $msgprops[PR_IPM_WASTEBASKET_ENTRYID], $entryids, [], true);
2898
-				}
2899
-				catch (MAPIException $e) {
2900
-					if ($e->getCode() === MAPI_E_NOT_IN_QUEUE || $e->getCode() === MAPI_E_UNABLE_TO_ABORT) {
2901
-						throw $e;
2902
-					}
2899
+					catch (MAPIException $e) {
2900
+						if ($e->getCode() === MAPI_E_NOT_IN_QUEUE || $e->getCode() === MAPI_E_UNABLE_TO_ABORT) {
2901
+							throw $e;
2902
+						}
2903 2903
 
2904
-					$e->setHandled();
2905
-					// if moving fails, try normal delete
2906
-					$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2907
-				}
2908
-				break;
2904
+						$e->setHandled();
2905
+						// if moving fails, try normal delete
2906
+						$result = mapi_folder_deletemessages($folder, $entryids, $flags);
2907
+					}
2908
+					break;
2909 2909
 			}
2910 2910
 
2911 2911
 			return $result;
Please login to merge, or discard this patch.