@@ -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) { |
@@ -247,14 +247,14 @@ discard block |
||
| 247 | 247 | $properties["reminderset"] = "PT_BOOLEAN:PSETID_Common:" . PidLidReminderSet; |
| 248 | 248 | $properties["flag_request"] = "PT_STRING8:PSETID_Common:" . PidLidFlagRequest; |
| 249 | 249 | $properties["flag_due_by"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderSignalTime; |
| 250 | - $properties["updatecounter"] = "PT_LONG:PSETID_Appointment:" . PidLidAppointmentSequence; // AppointmentSequenceNumber |
|
| 251 | - $properties["last_updatecounter"] = "PT_LONG:PSETID_Appointment:0x8203"; // AppointmentLastSequence |
|
| 250 | + $properties["updatecounter"] = "PT_LONG:PSETID_Appointment:" . PidLidAppointmentSequence; // AppointmentSequenceNumber |
|
| 251 | + $properties["last_updatecounter"] = "PT_LONG:PSETID_Appointment:0x8203"; // AppointmentLastSequence |
|
| 252 | 252 | $properties["busystatus"] = "PT_LONG:PSETID_Appointment:" . PidLidBusyStatus; |
| 253 | 253 | $properties["intendedbusystatus"] = "PT_LONG:PSETID_Appointment:" . PidLidIntendedBusyStatus; |
| 254 | 254 | $properties["start"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentStartWhole; |
| 255 | 255 | $properties["responselocation"] = "PT_STRING8:PSETID_Meeting:0x2"; |
| 256 | 256 | $properties["location"] = "PT_STRING8:PSETID_Appointment:" . PidLidLocation; |
| 257 | - $properties["requestsent"] = "PT_BOOLEAN:PSETID_Appointment:0x8229"; // PidLidFInvited, MeetingRequestWasSent |
|
| 257 | + $properties["requestsent"] = "PT_BOOLEAN:PSETID_Appointment:0x8229"; // PidLidFInvited, MeetingRequestWasSent |
|
| 258 | 258 | $properties["startdate"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentStartWhole; |
| 259 | 259 | $properties["duedate"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentEndWhole; |
| 260 | 260 | $properties["commonstart"] = "PT_SYSTIME:PSETID_Common:0x8516"; |
@@ -262,11 +262,11 @@ discard block |
||
| 262 | 262 | $properties["recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; |
| 263 | 263 | $properties["clipstart"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipStart; |
| 264 | 264 | $properties["clipend"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipEnd; |
| 265 | - $properties["start_recur_date"] = "PT_LONG:PSETID_Meeting:0xD"; // StartRecurTime |
|
| 266 | - $properties["start_recur_time"] = "PT_LONG:PSETID_Meeting:0xE"; // StartRecurTime |
|
| 267 | - $properties["end_recur_date"] = "PT_LONG:PSETID_Meeting:0xF"; // EndRecurDate |
|
| 268 | - $properties["end_recur_time"] = "PT_LONG:PSETID_Meeting:0x10"; // EndRecurTime |
|
| 269 | - $properties["is_exception"] = "PT_BOOLEAN:PSETID_Meeting:0xA"; // LID_IS_EXCEPTION |
|
| 265 | + $properties["start_recur_date"] = "PT_LONG:PSETID_Meeting:0xD"; // StartRecurTime |
|
| 266 | + $properties["start_recur_time"] = "PT_LONG:PSETID_Meeting:0xE"; // StartRecurTime |
|
| 267 | + $properties["end_recur_date"] = "PT_LONG:PSETID_Meeting:0xF"; // EndRecurDate |
|
| 268 | + $properties["end_recur_time"] = "PT_LONG:PSETID_Meeting:0x10"; // EndRecurTime |
|
| 269 | + $properties["is_exception"] = "PT_BOOLEAN:PSETID_Meeting:0xA"; // LID_IS_EXCEPTION |
|
| 270 | 270 | // Propose new time properties |
| 271 | 271 | $properties["proposed_start_whole"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentProposedStartWhole; |
| 272 | 272 | $properties["proposed_end_whole"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentProposedEndWhole; |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | $properties = []; |
| 640 | 640 | $properties["entryid"] = PR_ENTRYID; |
| 641 | 641 | $properties["parent_entryid"] = PR_PARENT_ENTRYID; |
| 642 | - $properties["store_entryid"] = PR_STORE_ENTRYID; // is this required ??? |
|
| 642 | + $properties["store_entryid"] = PR_STORE_ENTRYID; // is this required ??? |
|
| 643 | 643 | $properties["icon_index"] = PR_ICON_INDEX; |
| 644 | 644 | $properties["message_class"] = PR_MESSAGE_CLASS; |
| 645 | 645 | $properties["message_flags"] = PR_MESSAGE_FLAGS; |
@@ -955,9 +955,9 @@ discard block |
||
| 955 | 955 | $properties["appointment_location"] = "PT_STRING8:PSETID_Appointment:" . PidLidLocation; |
| 956 | 956 | $properties["appointment_recurring_pattern"] = "PT_STRING8:PSETID_Appointment:0x8232"; |
| 957 | 957 | $properties["appointment_recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; |
| 958 | - $properties["appointment_startdate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipStart; // ClipStart |
|
| 959 | - $properties["appointment_enddate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipEnd; // ClipEnd |
|
| 960 | - $properties["appointment_exception"] = "PT_BOOLEAN:PSETID_Meeting:0xA"; // LID_IS_EXCEPTION |
|
| 958 | + $properties["appointment_startdate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipStart; // ClipStart |
|
| 959 | + $properties["appointment_enddate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipEnd; // ClipEnd |
|
| 960 | + $properties["appointment_exception"] = "PT_BOOLEAN:PSETID_Meeting:0xA"; // LID_IS_EXCEPTION |
|
| 961 | 961 | $properties["appointment_location"] = "PT_STRING8:PSETID_Appointment:" . PidLidLocation; |
| 962 | 962 | // Propose new time properties |
| 963 | 963 | $properties["proposed_start_date"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentProposedStartWhole; |
@@ -1243,18 +1243,18 @@ discard block |
||
| 1243 | 1243 | $properties["subject"] = PR_SUBJECT; |
| 1244 | 1244 | $properties["object_type"] = PR_OBJECT_TYPE; |
| 1245 | 1245 | |
| 1246 | - $properties["reminder"] = "PT_BOOLEAN:PSETID_Common:" . PidLidReminderSet; // PidLidReminderSet |
|
| 1247 | - $properties["reminder_minutes"] = "PT_LONG:PSETID_Common:" . PidLidReminderDelta; // PidLidReminderDelta |
|
| 1248 | - $properties["reminder_time"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderTime; // PidLidReminderTime |
|
| 1249 | - $properties["flagdueby"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderSignalTime; // PidLidReminderSignalTime |
|
| 1246 | + $properties["reminder"] = "PT_BOOLEAN:PSETID_Common:" . PidLidReminderSet; // PidLidReminderSet |
|
| 1247 | + $properties["reminder_minutes"] = "PT_LONG:PSETID_Common:" . PidLidReminderDelta; // PidLidReminderDelta |
|
| 1248 | + $properties["reminder_time"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderTime; // PidLidReminderTime |
|
| 1249 | + $properties["flagdueby"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderSignalTime; // PidLidReminderSignalTime |
|
| 1250 | 1250 | |
| 1251 | - $properties["task_duedate"] = "PT_SYSTIME:PSETID_Task:" . PidLidTaskDueDate; // PidLidTaskDueDate |
|
| 1252 | - $properties["task_startdate"] = "PT_SYSTIME:PSETID_Task:" . PidLidTaskStartDate; // PidLidTaskStartDate |
|
| 1253 | - $properties["task_resetreminder"] = "PT_BOOLEAN:PSETID_Task:0x8107"; // PidLidTaskResetReminder |
|
| 1254 | - $properties["task_recurring"] = "PT_BOOLEAN:PSETID_Task:0x8126"; // PidLidTaskFRecurring |
|
| 1251 | + $properties["task_duedate"] = "PT_SYSTIME:PSETID_Task:" . PidLidTaskDueDate; // PidLidTaskDueDate |
|
| 1252 | + $properties["task_startdate"] = "PT_SYSTIME:PSETID_Task:" . PidLidTaskStartDate; // PidLidTaskStartDate |
|
| 1253 | + $properties["task_resetreminder"] = "PT_BOOLEAN:PSETID_Task:0x8107"; // PidLidTaskResetReminder |
|
| 1254 | + $properties["task_recurring"] = "PT_BOOLEAN:PSETID_Task:0x8126"; // PidLidTaskFRecurring |
|
| 1255 | 1255 | $properties["taskmode"] = "PT_LONG:PSETID_Common:0x8518"; |
| 1256 | 1256 | |
| 1257 | - $properties["appointment_recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; // PidLidRecurring |
|
| 1257 | + $properties["appointment_recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; // PidLidRecurring |
|
| 1258 | 1258 | $properties["appointment_startdate"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentStartWhole; |
| 1259 | 1259 | $properties["appointment_enddate"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentEndWhole; |
| 1260 | 1260 | $properties["appointment_startdate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipStart; |
@@ -218,7 +218,7 @@ |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | $Language->setLanguage($lang); |
| 221 | - setcookie('lang', $lang, [ 'expires' => time() + 31536000, 'path' => '/', 'domain' => '', 'secure' => true, 'httponly' => true, 'samesite' => 'Strict' ]); |
|
| 221 | + setcookie('lang', $lang, ['expires' => time() + 31536000, 'path' => '/', 'domain' => '', 'secure' => true, 'httponly' => true, 'samesite' => 'Strict']); |
|
| 222 | 222 | |
| 223 | 223 | // add extra header |
| 224 | 224 | header("X-grommunio: " . trim(file_get_contents('version'))); |
@@ -2119,9 +2119,9 @@ |
||
| 2119 | 2119 | $props = mapi_getprops($message, $properties); |
| 2120 | 2120 | // Do not update timezone information if the appointment times haven't changed |
| 2121 | 2121 | if (!isset($action['props']['commonstart']) && |
| 2122 | - !isset($action['props']['commonend']) && |
|
| 2123 | - !isset($action['props']['startdate']) && |
|
| 2124 | - !isset($action['props']['enddate']) |
|
| 2122 | + !isset($action['props']['commonend']) && |
|
| 2123 | + !isset($action['props']['startdate']) && |
|
| 2124 | + !isset($action['props']['enddate']) |
|
| 2125 | 2125 | ) { |
| 2126 | 2126 | unset($action['props']['tzdefstart'], $action['props']['tzdefend']); |
| 2127 | 2127 | } |
@@ -2059,9 +2059,9 @@ discard block |
||
| 2059 | 2059 | $messageProps = []; |
| 2060 | 2060 | // It stores the values that is exception allowed or not false -> not allowed |
| 2061 | 2061 | $isExceptionAllowed = true; |
| 2062 | - $delete = $actionType == 'delete'; // Flag for MeetingRequest Class whether to send update or cancel mail. |
|
| 2063 | - $basedate = false; // Flag for MeetingRequest Class whether to send an exception or not. |
|
| 2064 | - $isReminderTimeAllowed = true; // Flag to check reminder minutes is in range of the occurrences |
|
| 2062 | + $delete = $actionType == 'delete'; // Flag for MeetingRequest Class whether to send update or cancel mail. |
|
| 2063 | + $basedate = false; // Flag for MeetingRequest Class whether to send an exception or not. |
|
| 2064 | + $isReminderTimeAllowed = true; // Flag to check reminder minutes is in range of the occurrences |
|
| 2065 | 2065 | $properties = $GLOBALS['properties']->getAppointmentProperties(); |
| 2066 | 2066 | $send = false; |
| 2067 | 2067 | $oldProps = []; |
@@ -3003,7 +3003,7 @@ discard block |
||
| 3003 | 3003 | * convert flags of PR_MESSAGE_FLAGS property to flags that is |
| 3004 | 3004 | * used in mapi_message_setreadflag. |
| 3005 | 3005 | */ |
| 3006 | - $flag = MAPI_DEFERRED_ERRORS; // set unread flag, read receipt will be sent |
|
| 3006 | + $flag = MAPI_DEFERRED_ERRORS; // set unread flag, read receipt will be sent |
|
| 3007 | 3007 | |
| 3008 | 3008 | if (($flags & MSGFLAG_RN_PENDING) && isset($msg_action['send_read_receipt']) && $msg_action['send_read_receipt'] == false) { |
| 3009 | 3009 | $flag |= SUPPRESS_RECEIPT; |
@@ -3056,7 +3056,7 @@ discard block |
||
| 3056 | 3056 | |
| 3057 | 3057 | if (array_search(strtolower($foldername), $folderNames) !== false) { |
| 3058 | 3058 | $i = 2; |
| 3059 | - while (array_search(strtolower($foldername)." ($i)", $folderNames) !== false) |
|
| 3059 | + while (array_search(strtolower($foldername) . " ($i)", $folderNames) !== false) |
|
| 3060 | 3060 | ++$i; |
| 3061 | 3061 | $foldername .= " ($i)"; |
| 3062 | 3062 | } |
@@ -2088,7 +2088,8 @@ discard block |
||
| 2088 | 2088 | if (!empty($action['props']['timezone_iana'])) { |
| 2089 | 2089 | try { |
| 2090 | 2090 | $tzdef = mapi_ianatz_to_tzdef($action['props']['timezone_iana']); |
| 2091 | - } catch (Exception $e) { |
|
| 2091 | + } |
|
| 2092 | + catch (Exception $e) { |
|
| 2092 | 2093 | } |
| 2093 | 2094 | if ($tzdef !== false) { |
| 2094 | 2095 | $action['props']['tzdefstart'] = $action['props']['tzdefend'] = bin2hex($tzdef); |
@@ -2611,8 +2612,9 @@ discard block |
||
| 2611 | 2612 | $storeprops = mapi_getprops($store, [PR_IPM_OUTBOX_ENTRYID, PR_IPM_SENTMAIL_ENTRYID, PR_ENTRYID]); |
| 2612 | 2613 | $origStoreprops = mapi_getprops($origStore, [PR_ENTRYID]); |
| 2613 | 2614 | |
| 2614 | - if (!isset($storeprops[PR_IPM_OUTBOX_ENTRYID])) |
|
| 2615 | - return false; |
|
| 2615 | + if (!isset($storeprops[PR_IPM_OUTBOX_ENTRYID])) { |
|
| 2616 | + return false; |
|
| 2617 | + } |
|
| 2616 | 2618 | if (isset($storeprops[PR_IPM_SENTMAIL_ENTRYID])) { |
| 2617 | 2619 | $props[PR_SENTMAIL_ENTRYID] = $storeprops[PR_IPM_SENTMAIL_ENTRYID]; |
| 2618 | 2620 | } |
@@ -2779,8 +2781,9 @@ discard block |
||
| 2779 | 2781 | $message = $this->saveMessage($store, $entryid, $storeprops[PR_IPM_OUTBOX_ENTRYID], $props, $messageProps, $recipients, $attachments, [], $copyFromMessage, $copyAttachments, $copyRecipients, $copyInlineAttachmentsOnly, true, true, $isPlainText); |
| 2780 | 2782 | } |
| 2781 | 2783 | |
| 2782 | - if (!$message) |
|
| 2783 | - return false; |
|
| 2784 | + if (!$message) { |
|
| 2785 | + return false; |
|
| 2786 | + } |
|
| 2784 | 2787 | // Allowing to hook in just before the data sent away to be sent to the client |
| 2785 | 2788 | $GLOBALS['PluginManager']->triggerHook('server.core.operations.submitmessage', [ |
| 2786 | 2789 | 'moduleObject' => $this, |
@@ -3058,8 +3061,9 @@ discard block |
||
| 3058 | 3061 | |
| 3059 | 3062 | if (array_search(strtolower($foldername), $folderNames) !== false) { |
| 3060 | 3063 | $i = 2; |
| 3061 | - while (array_search(strtolower($foldername)." ($i)", $folderNames) !== false) |
|
| 3062 | - ++$i; |
|
| 3064 | + while (array_search(strtolower($foldername)." ($i)", $folderNames) !== false) { |
|
| 3065 | + ++$i; |
|
| 3066 | + } |
|
| 3063 | 3067 | $foldername .= " ($i)"; |
| 3064 | 3068 | } |
| 3065 | 3069 | |
@@ -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; |
@@ -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, 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) { |
@@ -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); |
@@ -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 |