@@ -52,31 +52,31 @@ |
||
| 52 | 52 | break; |
| 53 | 53 | case 'server.index.load.custom': |
| 54 | 54 | switch($data['name']) { |
| 55 | - case 'files_get_recipients': |
|
| 56 | - RecipientHandler::doGetRecipients(); |
|
| 57 | - break; |
|
| 58 | - case 'download_file': |
|
| 59 | - DownloadHandler::doDownload(); |
|
| 60 | - break; |
|
| 61 | - case 'upload_file': |
|
| 62 | - UploadHandler::doUpload(); |
|
| 63 | - break; |
|
| 64 | - case 'form': |
|
| 65 | - if (isset($_GET['backend'])) { |
|
| 66 | - $backend = urldecode($_GET["backend"]); |
|
| 67 | - } else { |
|
| 68 | - $backend = ''; |
|
| 69 | - } |
|
| 70 | - $backendstore = Files\Backend\BackendStore::getInstance(); |
|
| 55 | + case 'files_get_recipients': |
|
| 56 | + RecipientHandler::doGetRecipients(); |
|
| 57 | + break; |
|
| 58 | + case 'download_file': |
|
| 59 | + DownloadHandler::doDownload(); |
|
| 60 | + break; |
|
| 61 | + case 'upload_file': |
|
| 62 | + UploadHandler::doUpload(); |
|
| 63 | + break; |
|
| 64 | + case 'form': |
|
| 65 | + if (isset($_GET['backend'])) { |
|
| 66 | + $backend = urldecode($_GET["backend"]); |
|
| 67 | + } else { |
|
| 68 | + $backend = ''; |
|
| 69 | + } |
|
| 70 | + $backendstore = Files\Backend\BackendStore::getInstance(); |
|
| 71 | 71 | |
| 72 | - if ($backendstore->backendExists($backend)) { |
|
| 73 | - $backendInstance = $backendstore->getInstanceOfBackend($backend); |
|
| 74 | - $formdata = $backendInstance->getFormConfig(); |
|
| 75 | - die($formdata); |
|
| 76 | - } else { |
|
| 77 | - die("Specified backend does not exist!"); |
|
| 78 | - } |
|
| 79 | - break; |
|
| 72 | + if ($backendstore->backendExists($backend)) { |
|
| 73 | + $backendInstance = $backendstore->getInstanceOfBackend($backend); |
|
| 74 | + $formdata = $backendInstance->getFormConfig(); |
|
| 75 | + die($formdata); |
|
| 76 | + } else { |
|
| 77 | + die("Specified backend does not exist!"); |
|
| 78 | + } |
|
| 79 | + break; |
|
| 80 | 80 | } |
| 81 | 81 | break; |
| 82 | 82 | } |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | switch ($this->status) { |
| 36 | - case 'good': |
|
| 37 | - return OCSP_CERT_STATUS_GOOD; |
|
| 38 | - case 'revoked': |
|
| 39 | - return OCSP_CERT_STATUS_REVOKED; |
|
| 40 | - default: |
|
| 41 | - return OCSP_CERT_STATUS_UNKOWN; |
|
| 36 | + case 'good': |
|
| 37 | + return OCSP_CERT_STATUS_GOOD; |
|
| 38 | + case 'revoked': |
|
| 39 | + return OCSP_CERT_STATUS_REVOKED; |
|
| 40 | + default: |
|
| 41 | + return OCSP_CERT_STATUS_UNKOWN; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -207,83 +207,83 @@ |
||
| 207 | 207 | function mapi_strerror($e) |
| 208 | 208 | { |
| 209 | 209 | switch ($e) { |
| 210 | - case S_OK: return "success"; |
|
| 211 | - case MAPI_E_CALL_FAILED: return "An error of unexpected or unknown origin occurred"; |
|
| 212 | - case MAPI_E_NOT_ENOUGH_MEMORY: return "Not enough memory was available to complete the operation"; |
|
| 213 | - case MAPI_E_INVALID_PARAMETER: return "An invalid parameter was passed to a function or remote procedure call"; |
|
| 214 | - case MAPI_E_INTERFACE_NOT_SUPPORTED: return "MAPI interface not supported"; |
|
| 215 | - case MAPI_E_NO_ACCESS: return "An attempt was made to access a message store or object for which the user has insufficient permissions"; |
|
| 216 | - case MAPI_E_NO_SUPPORT: return "Function is not implemented"; |
|
| 217 | - case MAPI_E_BAD_CHARWIDTH: return "An incompatibility exists in the character sets supported by the caller and the implementation"; |
|
| 218 | - case MAPI_E_STRING_TOO_LONG: return "In the context of this method call, a string exceeds the maximum permitted length"; |
|
| 219 | - case MAPI_E_UNKNOWN_FLAGS: return "One or more values for a flags parameter were not valid"; |
|
| 220 | - case MAPI_E_INVALID_ENTRYID: return "invalid entryid"; |
|
| 221 | - case MAPI_E_INVALID_OBJECT: return "A method call was made using a reference to an object that has been destroyed or is not in a viable state"; |
|
| 222 | - case MAPI_E_OBJECT_CHANGED: return "An attempt to commit changes failed because the object was changed separately"; |
|
| 223 | - case MAPI_E_OBJECT_DELETED: return "An operation failed because the object was deleted separately"; |
|
| 224 | - case MAPI_E_BUSY: return "A table operation failed because a separate operation was in progress at the same time"; |
|
| 225 | - case MAPI_E_NOT_ENOUGH_DISK: return "Not enough disk space was available to complete the operation"; |
|
| 226 | - case MAPI_E_NOT_ENOUGH_RESOURCES: return "Not enough system resources were available to complete the operation"; |
|
| 227 | - case MAPI_E_NOT_FOUND: return "The requested object could not be found at the server"; |
|
| 228 | - case MAPI_E_VERSION: return "Client and server versions are not compatible"; |
|
| 229 | - case MAPI_E_LOGON_FAILED: return "A client was unable to log on to the server"; |
|
| 230 | - case MAPI_E_SESSION_LIMIT: return "A server or service is unable to create any more sessions"; |
|
| 231 | - case MAPI_E_USER_CANCEL: return "An operation failed because a user cancelled it"; |
|
| 232 | - case MAPI_E_UNABLE_TO_ABORT: return "A ropAbort or ropAbortSubmit ROP request was unsuccessful"; |
|
| 233 | - case MAPI_E_NETWORK_ERROR: return "An operation was unsuccessful because of a problem with network operations or services"; |
|
| 234 | - case MAPI_E_DISK_ERROR: return "There was a problem writing to or reading from disk"; |
|
| 235 | - case MAPI_E_TOO_COMPLEX: return "The operation requested is too complex for the server to handle (often w.r.t. restrictions)"; |
|
| 236 | - case MAPI_E_BAD_COLUMN: return "The column requested is not allowed in this type of table"; |
|
| 237 | - case MAPI_E_EXTENDED_ERROR: return "extended error"; |
|
| 238 | - case MAPI_E_COMPUTED: return "A property cannot be updated because it is read-only, computed by the server"; |
|
| 239 | - case MAPI_E_CORRUPT_DATA: return "There is an internal inconsistency in a database, or in a complex property value"; |
|
| 240 | - case MAPI_E_UNCONFIGURED: return "unconfigured"; |
|
| 241 | - case MAPI_E_FAILONEPROVIDER: return "failoneprovider"; |
|
| 242 | - case MAPI_E_UNKNOWN_CPID: return "The server is not configured to support the code page requested by the client"; |
|
| 243 | - case MAPI_E_UNKNOWN_LCID: return "The server is not configured to support the locale requested by the client"; |
|
| 244 | - case MAPI_E_PASSWORD_CHANGE_REQUIRED: return "password change required"; |
|
| 245 | - case MAPI_E_PASSWORD_EXPIRED: return "password expired"; |
|
| 246 | - case MAPI_E_INVALID_WORKSTATION_ACCOUNT: return "invalid workstation account"; |
|
| 247 | - case MAPI_E_INVALID_ACCESS_TIME: return "The operation failed due to clock skew between servers"; |
|
| 248 | - case MAPI_E_ACCOUNT_DISABLED: return "account disabled"; |
|
| 249 | - case MAPI_E_END_OF_SESSION: return "The server session has been destroyed, possibly by a server restart"; |
|
| 250 | - case MAPI_E_UNKNOWN_ENTRYID: return "The EntryID passed to OpenEntry was created by a different MAPI provider"; |
|
| 251 | - case MAPI_E_MISSING_REQUIRED_COLUMN: return "missing required column"; |
|
| 252 | - case MAPI_W_NO_SERVICE: return "no service"; |
|
| 253 | - case MAPI_E_BAD_VALUE: return "bad value"; |
|
| 254 | - case MAPI_E_INVALID_TYPE: return "invalid type"; |
|
| 255 | - case MAPI_E_TYPE_NO_SUPPORT: return "type no support"; |
|
| 256 | - case MAPI_E_UNEXPECTED_TYPE: return "unexpected_type"; |
|
| 257 | - case MAPI_E_TOO_BIG: return "The table is too big for the requested operation to complete"; |
|
| 258 | - case MAPI_E_DECLINE_COPY: return "The provider implements this method by calling a support object method, and the caller has passed the MAPI_DECLINE_OK flag"; |
|
| 259 | - case MAPI_E_UNEXPECTED_ID: return "unexpected id"; |
|
| 260 | - case MAPI_W_ERRORS_RETURNED: return "The call succeeded, but the message store provider has error information available"; |
|
| 261 | - case MAPI_E_UNABLE_TO_COMPLETE: return "A complex operation such as building a table row set could not be completed"; |
|
| 262 | - case MAPI_E_TIMEOUT: return "An asynchronous operation did not succeed within the specified time-out"; |
|
| 263 | - case MAPI_E_TABLE_EMPTY: return "A table essential to the operation is empty"; |
|
| 264 | - case MAPI_E_TABLE_TOO_BIG: return "The table is too big for the requested operation to complete"; |
|
| 265 | - case MAPI_E_INVALID_BOOKMARK: return "The bookmark passed to a table operation was not created on the same table"; |
|
| 266 | - case MAPI_W_POSITION_CHANGED: return "position changed"; |
|
| 267 | - case MAPI_W_APPROX_COUNT: return "approx count"; |
|
| 268 | - case MAPI_E_WAIT: return "A wait time-out has expired"; |
|
| 269 | - case MAPI_E_CANCEL: return "The operation had to be canceled"; |
|
| 270 | - case MAPI_E_NOT_ME: return "not me"; |
|
| 271 | - case MAPI_W_CANCEL_MESSAGE: return "cancel message"; |
|
| 272 | - case MAPI_E_CORRUPT_STORE: return "corrupt store"; |
|
| 273 | - case MAPI_E_NOT_IN_QUEUE: return "not in queue"; |
|
| 274 | - case MAPI_E_NO_SUPPRESS: return "The server does not support the suppression of read receipts"; |
|
| 275 | - case MAPI_E_COLLISION: return "A folder or item cannot be created because one with the same name or other criteria already exists"; |
|
| 276 | - case MAPI_E_NOT_INITIALIZED: return "The subsystem is not ready"; |
|
| 277 | - case MAPI_E_NON_STANDARD: return "non standard"; |
|
| 278 | - case MAPI_E_NO_RECIPIENTS: return "A message cannot be sent because it has no recipients"; |
|
| 279 | - case MAPI_E_SUBMITTED: return "A message cannot be opened for modification because it has already been sent"; |
|
| 280 | - case MAPI_E_HAS_FOLDERS: return "A folder cannot be deleted because it still contains subfolders"; |
|
| 281 | - case MAPI_E_HAS_MESSAGES: return "A folder cannot be deleted because it still contains messages"; |
|
| 282 | - case MAPI_E_FOLDER_CYCLE: return "A folder move or copy operation would create a cycle"; |
|
| 283 | - case MAPI_W_PARTIAL_COMPLETION: return "The call succeeded, but not all entries were successfully operated on"; |
|
| 284 | - case MAPI_E_AMBIGUOUS_RECIP: return "An unresolved recipient matches more than one directory entry"; |
|
| 285 | - case MAPI_E_STORE_FULL: return "Store full"; |
|
| 286 | - default: return sprintf("%xh", $e); |
|
| 210 | + case S_OK: return "success"; |
|
| 211 | + case MAPI_E_CALL_FAILED: return "An error of unexpected or unknown origin occurred"; |
|
| 212 | + case MAPI_E_NOT_ENOUGH_MEMORY: return "Not enough memory was available to complete the operation"; |
|
| 213 | + case MAPI_E_INVALID_PARAMETER: return "An invalid parameter was passed to a function or remote procedure call"; |
|
| 214 | + case MAPI_E_INTERFACE_NOT_SUPPORTED: return "MAPI interface not supported"; |
|
| 215 | + case MAPI_E_NO_ACCESS: return "An attempt was made to access a message store or object for which the user has insufficient permissions"; |
|
| 216 | + case MAPI_E_NO_SUPPORT: return "Function is not implemented"; |
|
| 217 | + case MAPI_E_BAD_CHARWIDTH: return "An incompatibility exists in the character sets supported by the caller and the implementation"; |
|
| 218 | + case MAPI_E_STRING_TOO_LONG: return "In the context of this method call, a string exceeds the maximum permitted length"; |
|
| 219 | + case MAPI_E_UNKNOWN_FLAGS: return "One or more values for a flags parameter were not valid"; |
|
| 220 | + case MAPI_E_INVALID_ENTRYID: return "invalid entryid"; |
|
| 221 | + case MAPI_E_INVALID_OBJECT: return "A method call was made using a reference to an object that has been destroyed or is not in a viable state"; |
|
| 222 | + case MAPI_E_OBJECT_CHANGED: return "An attempt to commit changes failed because the object was changed separately"; |
|
| 223 | + case MAPI_E_OBJECT_DELETED: return "An operation failed because the object was deleted separately"; |
|
| 224 | + case MAPI_E_BUSY: return "A table operation failed because a separate operation was in progress at the same time"; |
|
| 225 | + case MAPI_E_NOT_ENOUGH_DISK: return "Not enough disk space was available to complete the operation"; |
|
| 226 | + case MAPI_E_NOT_ENOUGH_RESOURCES: return "Not enough system resources were available to complete the operation"; |
|
| 227 | + case MAPI_E_NOT_FOUND: return "The requested object could not be found at the server"; |
|
| 228 | + case MAPI_E_VERSION: return "Client and server versions are not compatible"; |
|
| 229 | + case MAPI_E_LOGON_FAILED: return "A client was unable to log on to the server"; |
|
| 230 | + case MAPI_E_SESSION_LIMIT: return "A server or service is unable to create any more sessions"; |
|
| 231 | + case MAPI_E_USER_CANCEL: return "An operation failed because a user cancelled it"; |
|
| 232 | + case MAPI_E_UNABLE_TO_ABORT: return "A ropAbort or ropAbortSubmit ROP request was unsuccessful"; |
|
| 233 | + case MAPI_E_NETWORK_ERROR: return "An operation was unsuccessful because of a problem with network operations or services"; |
|
| 234 | + case MAPI_E_DISK_ERROR: return "There was a problem writing to or reading from disk"; |
|
| 235 | + case MAPI_E_TOO_COMPLEX: return "The operation requested is too complex for the server to handle (often w.r.t. restrictions)"; |
|
| 236 | + case MAPI_E_BAD_COLUMN: return "The column requested is not allowed in this type of table"; |
|
| 237 | + case MAPI_E_EXTENDED_ERROR: return "extended error"; |
|
| 238 | + case MAPI_E_COMPUTED: return "A property cannot be updated because it is read-only, computed by the server"; |
|
| 239 | + case MAPI_E_CORRUPT_DATA: return "There is an internal inconsistency in a database, or in a complex property value"; |
|
| 240 | + case MAPI_E_UNCONFIGURED: return "unconfigured"; |
|
| 241 | + case MAPI_E_FAILONEPROVIDER: return "failoneprovider"; |
|
| 242 | + case MAPI_E_UNKNOWN_CPID: return "The server is not configured to support the code page requested by the client"; |
|
| 243 | + case MAPI_E_UNKNOWN_LCID: return "The server is not configured to support the locale requested by the client"; |
|
| 244 | + case MAPI_E_PASSWORD_CHANGE_REQUIRED: return "password change required"; |
|
| 245 | + case MAPI_E_PASSWORD_EXPIRED: return "password expired"; |
|
| 246 | + case MAPI_E_INVALID_WORKSTATION_ACCOUNT: return "invalid workstation account"; |
|
| 247 | + case MAPI_E_INVALID_ACCESS_TIME: return "The operation failed due to clock skew between servers"; |
|
| 248 | + case MAPI_E_ACCOUNT_DISABLED: return "account disabled"; |
|
| 249 | + case MAPI_E_END_OF_SESSION: return "The server session has been destroyed, possibly by a server restart"; |
|
| 250 | + case MAPI_E_UNKNOWN_ENTRYID: return "The EntryID passed to OpenEntry was created by a different MAPI provider"; |
|
| 251 | + case MAPI_E_MISSING_REQUIRED_COLUMN: return "missing required column"; |
|
| 252 | + case MAPI_W_NO_SERVICE: return "no service"; |
|
| 253 | + case MAPI_E_BAD_VALUE: return "bad value"; |
|
| 254 | + case MAPI_E_INVALID_TYPE: return "invalid type"; |
|
| 255 | + case MAPI_E_TYPE_NO_SUPPORT: return "type no support"; |
|
| 256 | + case MAPI_E_UNEXPECTED_TYPE: return "unexpected_type"; |
|
| 257 | + case MAPI_E_TOO_BIG: return "The table is too big for the requested operation to complete"; |
|
| 258 | + case MAPI_E_DECLINE_COPY: return "The provider implements this method by calling a support object method, and the caller has passed the MAPI_DECLINE_OK flag"; |
|
| 259 | + case MAPI_E_UNEXPECTED_ID: return "unexpected id"; |
|
| 260 | + case MAPI_W_ERRORS_RETURNED: return "The call succeeded, but the message store provider has error information available"; |
|
| 261 | + case MAPI_E_UNABLE_TO_COMPLETE: return "A complex operation such as building a table row set could not be completed"; |
|
| 262 | + case MAPI_E_TIMEOUT: return "An asynchronous operation did not succeed within the specified time-out"; |
|
| 263 | + case MAPI_E_TABLE_EMPTY: return "A table essential to the operation is empty"; |
|
| 264 | + case MAPI_E_TABLE_TOO_BIG: return "The table is too big for the requested operation to complete"; |
|
| 265 | + case MAPI_E_INVALID_BOOKMARK: return "The bookmark passed to a table operation was not created on the same table"; |
|
| 266 | + case MAPI_W_POSITION_CHANGED: return "position changed"; |
|
| 267 | + case MAPI_W_APPROX_COUNT: return "approx count"; |
|
| 268 | + case MAPI_E_WAIT: return "A wait time-out has expired"; |
|
| 269 | + case MAPI_E_CANCEL: return "The operation had to be canceled"; |
|
| 270 | + case MAPI_E_NOT_ME: return "not me"; |
|
| 271 | + case MAPI_W_CANCEL_MESSAGE: return "cancel message"; |
|
| 272 | + case MAPI_E_CORRUPT_STORE: return "corrupt store"; |
|
| 273 | + case MAPI_E_NOT_IN_QUEUE: return "not in queue"; |
|
| 274 | + case MAPI_E_NO_SUPPRESS: return "The server does not support the suppression of read receipts"; |
|
| 275 | + case MAPI_E_COLLISION: return "A folder or item cannot be created because one with the same name or other criteria already exists"; |
|
| 276 | + case MAPI_E_NOT_INITIALIZED: return "The subsystem is not ready"; |
|
| 277 | + case MAPI_E_NON_STANDARD: return "non standard"; |
|
| 278 | + case MAPI_E_NO_RECIPIENTS: return "A message cannot be sent because it has no recipients"; |
|
| 279 | + case MAPI_E_SUBMITTED: return "A message cannot be opened for modification because it has already been sent"; |
|
| 280 | + case MAPI_E_HAS_FOLDERS: return "A folder cannot be deleted because it still contains subfolders"; |
|
| 281 | + case MAPI_E_HAS_MESSAGES: return "A folder cannot be deleted because it still contains messages"; |
|
| 282 | + case MAPI_E_FOLDER_CYCLE: return "A folder move or copy operation would create a cycle"; |
|
| 283 | + case MAPI_W_PARTIAL_COMPLETION: return "The call succeeded, but not all entries were successfully operated on"; |
|
| 284 | + case MAPI_E_AMBIGUOUS_RECIP: return "An unresolved recipient matches more than one directory entry"; |
|
| 285 | + case MAPI_E_STORE_FULL: return "Store full"; |
|
| 286 | + default: return sprintf("%xh", $e); |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
@@ -1675,180 +1675,180 @@ |
||
| 1675 | 1675 | |
| 1676 | 1676 | switch($this->recur["type"]) |
| 1677 | 1677 | { |
| 1678 | - case 10: |
|
| 1679 | - // Daily |
|
| 1680 | - if($this->recur["everyn"] <= 0) |
|
| 1681 | - $this->recur["everyn"] = 1440; |
|
| 1682 | - |
|
| 1683 | - if($this->recur["subtype"] == 0) { |
|
| 1684 | - // Every Nth day |
|
| 1685 | - for($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += 60 * $this->recur["everyn"]) { |
|
| 1686 | - $this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1687 | - } |
|
| 1688 | - } else { |
|
| 1689 | - // Every workday |
|
| 1690 | - for($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += 60 * 1440) |
|
| 1691 | - { |
|
| 1692 | - $nowtime = $this->gmtime($now); |
|
| 1693 | - if ($nowtime["tm_wday"] > 0 && $nowtime["tm_wday"] < 6) { // only add items in the given timespace |
|
| 1694 | - $this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1695 | - } |
|
| 1696 | - } |
|
| 1697 | - } |
|
| 1698 | - break; |
|
| 1699 | - case 11: |
|
| 1700 | - // Weekly |
|
| 1701 | - if($this->recur["everyn"] <= 0) |
|
| 1702 | - $this->recur["everyn"] = 1; |
|
| 1703 | - |
|
| 1704 | - // If sliding flag is set then move to 'n' weeks |
|
| 1705 | - if ($this->recur['regen']) $daystart += (60 * 60 * 24 * 7 * $this->recur["everyn"]); |
|
| 1706 | - |
|
| 1707 | - for($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += (60 * 60 * 24 * 7 * $this->recur["everyn"])) |
|
| 1708 | - { |
|
| 1709 | - if ($this->recur['regen']) { |
|
| 1710 | - $this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1711 | - } else { |
|
| 1712 | - // Loop through the whole following week to the first occurrence of the week, add each day that is specified |
|
| 1713 | - for($wday = 0; $wday < 7; $wday++) |
|
| 1714 | - { |
|
| 1715 | - $daynow = $now + $wday * 60 * 60 * 24; |
|
| 1716 | - //checks weather the next coming day in recurring pattern is less than or equal to end day of the recurring item |
|
| 1717 | - if ($daynow <= $dayend){ |
|
| 1718 | - $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1719 | - if(($this->recur["weekdays"] &(1 << $nowtime["tm_wday"]))) { // Selected ? |
|
| 1720 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1721 | - } |
|
| 1722 | - } |
|
| 1723 | - } |
|
| 1724 | - } |
|
| 1725 | - } |
|
| 1726 | - break; |
|
| 1727 | - case 12: |
|
| 1728 | - // Monthly |
|
| 1729 | - if($this->recur["everyn"] <= 0) |
|
| 1730 | - $this->recur["everyn"] = 1; |
|
| 1731 | - |
|
| 1732 | - // Loop through all months from start to end of occurrence, starting at beginning of first month |
|
| 1733 | - for($now = $this->monthStartOf($daystart); $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += $this->daysInMonth($now, $this->recur["everyn"]) * 24 * 60 * 60 ) |
|
| 1734 | - { |
|
| 1735 | - if(isset($this->recur["monthday"]) &&($this->recur['monthday'] != "undefined") && !$this->recur['regen']) { // Day M of every N months |
|
| 1736 | - $difference = 1; |
|
| 1737 | - if ($this->daysInMonth($now, $this->recur["everyn"]) < $this->recur["monthday"]) { |
|
| 1738 | - $difference = $this->recur["monthday"] - $this->daysInMonth($now, $this->recur["everyn"]) + 1; |
|
| 1739 | - } |
|
| 1740 | - $daynow = $now + (($this->recur["monthday"] - $difference) * 24 * 60 * 60); |
|
| 1741 | - //checks weather the next coming day in recurrence pattern is less than or equal to end day of the recurring item |
|
| 1742 | - if ($daynow <= $dayend){ |
|
| 1743 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1744 | - } |
|
| 1745 | - } |
|
| 1746 | - else if(isset($this->recur["nday"]) && isset($this->recur["weekdays"])) { // Nth [weekday] of every N months |
|
| 1747 | - // Sanitize input |
|
| 1748 | - if($this->recur["weekdays"] == 0) |
|
| 1749 | - $this->recur["weekdays"] = 1; |
|
| 1750 | - |
|
| 1751 | - // If nday is not set to the last day in the month |
|
| 1752 | - if ($this->recur["nday"] < 5) { |
|
| 1753 | - // keep the track of no. of time correct selection pattern(like 2nd weekday, 4th fiday, etc.)is matched |
|
| 1754 | - $ndaycounter = 0; |
|
| 1755 | - // Find matching weekday in this month |
|
| 1756 | - for($day = 0, $total = $this->daysInMonth($now, 1); $day < $total; $day++) |
|
| 1757 | - { |
|
| 1758 | - $daynow = $now + $day * 60 * 60 * 24; |
|
| 1759 | - $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1760 | - |
|
| 1761 | - if($this->recur["weekdays"] & (1 << $nowtime["tm_wday"])) { // Selected ? |
|
| 1762 | - $ndaycounter ++; |
|
| 1763 | - } |
|
| 1764 | - // check the selected pattern is same as asked Nth weekday,If so set the firstday |
|
| 1765 | - if($this->recur["nday"] == $ndaycounter){ |
|
| 1766 | - $firstday = $day; |
|
| 1767 | - break; |
|
| 1768 | - } |
|
| 1769 | - } |
|
| 1770 | - // $firstday is the day of the month on which the asked pattern of nth weekday matches |
|
| 1771 | - $daynow = $now + $firstday * 60 * 60 * 24; |
|
| 1772 | - } else { |
|
| 1773 | - // Find last day in the month ($now is the firstday of the month) |
|
| 1774 | - $NumDaysInMonth = $this->daysInMonth($now, 1); |
|
| 1775 | - $daynow = $now + (($NumDaysInMonth-1) * 24*60*60); |
|
| 1776 | - |
|
| 1777 | - $nowtime = $this->gmtime($daynow); |
|
| 1778 | - while (($this->recur["weekdays"] & (1 << $nowtime["tm_wday"]))==0){ |
|
| 1779 | - $daynow -= 86400; |
|
| 1780 | - $nowtime = $this->gmtime($daynow); |
|
| 1781 | - } |
|
| 1782 | - } |
|
| 1783 | - |
|
| 1784 | - /** |
|
| 1678 | + case 10: |
|
| 1679 | + // Daily |
|
| 1680 | + if($this->recur["everyn"] <= 0) |
|
| 1681 | + $this->recur["everyn"] = 1440; |
|
| 1682 | + |
|
| 1683 | + if($this->recur["subtype"] == 0) { |
|
| 1684 | + // Every Nth day |
|
| 1685 | + for($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += 60 * $this->recur["everyn"]) { |
|
| 1686 | + $this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1687 | + } |
|
| 1688 | + } else { |
|
| 1689 | + // Every workday |
|
| 1690 | + for($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += 60 * 1440) |
|
| 1691 | + { |
|
| 1692 | + $nowtime = $this->gmtime($now); |
|
| 1693 | + if ($nowtime["tm_wday"] > 0 && $nowtime["tm_wday"] < 6) { // only add items in the given timespace |
|
| 1694 | + $this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1695 | + } |
|
| 1696 | + } |
|
| 1697 | + } |
|
| 1698 | + break; |
|
| 1699 | + case 11: |
|
| 1700 | + // Weekly |
|
| 1701 | + if($this->recur["everyn"] <= 0) |
|
| 1702 | + $this->recur["everyn"] = 1; |
|
| 1703 | + |
|
| 1704 | + // If sliding flag is set then move to 'n' weeks |
|
| 1705 | + if ($this->recur['regen']) $daystart += (60 * 60 * 24 * 7 * $this->recur["everyn"]); |
|
| 1706 | + |
|
| 1707 | + for($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += (60 * 60 * 24 * 7 * $this->recur["everyn"])) |
|
| 1708 | + { |
|
| 1709 | + if ($this->recur['regen']) { |
|
| 1710 | + $this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1711 | + } else { |
|
| 1712 | + // Loop through the whole following week to the first occurrence of the week, add each day that is specified |
|
| 1713 | + for($wday = 0; $wday < 7; $wday++) |
|
| 1714 | + { |
|
| 1715 | + $daynow = $now + $wday * 60 * 60 * 24; |
|
| 1716 | + //checks weather the next coming day in recurring pattern is less than or equal to end day of the recurring item |
|
| 1717 | + if ($daynow <= $dayend){ |
|
| 1718 | + $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1719 | + if(($this->recur["weekdays"] &(1 << $nowtime["tm_wday"]))) { // Selected ? |
|
| 1720 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1721 | + } |
|
| 1722 | + } |
|
| 1723 | + } |
|
| 1724 | + } |
|
| 1725 | + } |
|
| 1726 | + break; |
|
| 1727 | + case 12: |
|
| 1728 | + // Monthly |
|
| 1729 | + if($this->recur["everyn"] <= 0) |
|
| 1730 | + $this->recur["everyn"] = 1; |
|
| 1731 | + |
|
| 1732 | + // Loop through all months from start to end of occurrence, starting at beginning of first month |
|
| 1733 | + for($now = $this->monthStartOf($daystart); $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += $this->daysInMonth($now, $this->recur["everyn"]) * 24 * 60 * 60 ) |
|
| 1734 | + { |
|
| 1735 | + if(isset($this->recur["monthday"]) &&($this->recur['monthday'] != "undefined") && !$this->recur['regen']) { // Day M of every N months |
|
| 1736 | + $difference = 1; |
|
| 1737 | + if ($this->daysInMonth($now, $this->recur["everyn"]) < $this->recur["monthday"]) { |
|
| 1738 | + $difference = $this->recur["monthday"] - $this->daysInMonth($now, $this->recur["everyn"]) + 1; |
|
| 1739 | + } |
|
| 1740 | + $daynow = $now + (($this->recur["monthday"] - $difference) * 24 * 60 * 60); |
|
| 1741 | + //checks weather the next coming day in recurrence pattern is less than or equal to end day of the recurring item |
|
| 1742 | + if ($daynow <= $dayend){ |
|
| 1743 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1744 | + } |
|
| 1745 | + } |
|
| 1746 | + else if(isset($this->recur["nday"]) && isset($this->recur["weekdays"])) { // Nth [weekday] of every N months |
|
| 1747 | + // Sanitize input |
|
| 1748 | + if($this->recur["weekdays"] == 0) |
|
| 1749 | + $this->recur["weekdays"] = 1; |
|
| 1750 | + |
|
| 1751 | + // If nday is not set to the last day in the month |
|
| 1752 | + if ($this->recur["nday"] < 5) { |
|
| 1753 | + // keep the track of no. of time correct selection pattern(like 2nd weekday, 4th fiday, etc.)is matched |
|
| 1754 | + $ndaycounter = 0; |
|
| 1755 | + // Find matching weekday in this month |
|
| 1756 | + for($day = 0, $total = $this->daysInMonth($now, 1); $day < $total; $day++) |
|
| 1757 | + { |
|
| 1758 | + $daynow = $now + $day * 60 * 60 * 24; |
|
| 1759 | + $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1760 | + |
|
| 1761 | + if($this->recur["weekdays"] & (1 << $nowtime["tm_wday"])) { // Selected ? |
|
| 1762 | + $ndaycounter ++; |
|
| 1763 | + } |
|
| 1764 | + // check the selected pattern is same as asked Nth weekday,If so set the firstday |
|
| 1765 | + if($this->recur["nday"] == $ndaycounter){ |
|
| 1766 | + $firstday = $day; |
|
| 1767 | + break; |
|
| 1768 | + } |
|
| 1769 | + } |
|
| 1770 | + // $firstday is the day of the month on which the asked pattern of nth weekday matches |
|
| 1771 | + $daynow = $now + $firstday * 60 * 60 * 24; |
|
| 1772 | + } else { |
|
| 1773 | + // Find last day in the month ($now is the firstday of the month) |
|
| 1774 | + $NumDaysInMonth = $this->daysInMonth($now, 1); |
|
| 1775 | + $daynow = $now + (($NumDaysInMonth-1) * 24*60*60); |
|
| 1776 | + |
|
| 1777 | + $nowtime = $this->gmtime($daynow); |
|
| 1778 | + while (($this->recur["weekdays"] & (1 << $nowtime["tm_wday"]))==0){ |
|
| 1779 | + $daynow -= 86400; |
|
| 1780 | + $nowtime = $this->gmtime($daynow); |
|
| 1781 | + } |
|
| 1782 | + } |
|
| 1783 | + |
|
| 1784 | + /** |
|
| 1785 | 1785 | * checks weather the next coming day in recurrence pattern is less than or equal to end day of the * recurring item.Also check weather the coming day in recurrence pattern is greater than or equal to start * of recurring pattern, so that appointment that fall under the recurrence range are only displayed. |
| 1786 | 1786 | */ |
| 1787 | - if ($daynow <= $dayend && $daynow >= $daystart){ |
|
| 1788 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz , $remindersonly); |
|
| 1789 | - } |
|
| 1790 | - } else if ($this->recur['regen']) { |
|
| 1791 | - $next_month_start = $now + ($this->daysInMonth($now, 1) * 24 * 60 * 60); |
|
| 1792 | - $now = $daystart +($this->daysInMonth($next_month_start, $this->recur['everyn']) * 24 * 60 * 60); |
|
| 1793 | - |
|
| 1794 | - if ($now <= $dayend) { |
|
| 1795 | - $this->processOccurrenceItem($items, $daystart, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1796 | - } |
|
| 1797 | - } |
|
| 1798 | - } |
|
| 1799 | - break; |
|
| 1800 | - case 13: |
|
| 1801 | - // Yearly |
|
| 1802 | - if($this->recur["everyn"] <= 0) |
|
| 1803 | - $this->recur["everyn"] = 12; |
|
| 1804 | - |
|
| 1805 | - for($now = $this->yearStartOf($daystart); $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += $this->daysInMonth($now, $this->recur["everyn"]) * 24 * 60 * 60 ) |
|
| 1806 | - { |
|
| 1807 | - if(isset($this->recur["monthday"]) && !$this->recur['regen']) { // same as monthly, but in a specific month |
|
| 1808 | - // recur["month"] is in minutes since the beginning of the year |
|
| 1809 | - $month = $this->monthOfYear($this->recur["month"]); // $month is now month of year [0..11] |
|
| 1810 | - $monthday = $this->recur["monthday"]; // $monthday is day of the month [1..31] |
|
| 1811 | - $monthstart = $now + $this->daysInMonth($now, $month) * 24 * 60 * 60; // $monthstart is the timestamp of the beginning of the month |
|
| 1812 | - if($monthday > $this->daysInMonth($monthstart, 1)) |
|
| 1813 | - $monthday = $this->daysInMonth($monthstart, 1); // Cap $monthday on month length (eg 28 feb instead of 29 feb) |
|
| 1814 | - $daynow = $monthstart + ($monthday-1) * 24 * 60 * 60; |
|
| 1815 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1816 | - } |
|
| 1817 | - else if(isset($this->recur["nday"]) && isset($this->recur["weekdays"])) { // Nth [weekday] in month X of every N years |
|
| 1818 | - |
|
| 1819 | - // Go the correct month |
|
| 1820 | - $monthnow = $now + $this->daysInMonth($now, $this->monthOfYear($this->recur["month"])) * 24 * 60 * 60; |
|
| 1821 | - |
|
| 1822 | - // Find first matching weekday in this month |
|
| 1823 | - for($wday = 0; $wday < 7; $wday++) |
|
| 1824 | - { |
|
| 1825 | - $daynow = $monthnow + $wday * 60 * 60 * 24; |
|
| 1826 | - $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1827 | - |
|
| 1828 | - if($this->recur["weekdays"] & (1 << $nowtime["tm_wday"])) { // Selected ? |
|
| 1829 | - $firstday = $wday; |
|
| 1830 | - break; |
|
| 1831 | - } |
|
| 1832 | - } |
|
| 1833 | - |
|
| 1834 | - // Same as above (monthly) |
|
| 1835 | - $daynow = $monthnow + ($firstday + ($this->recur["nday"]-1)*7) * 60 * 60 * 24; |
|
| 1836 | - |
|
| 1837 | - while($this->monthStartOf($daynow) != $this->monthStartOf($monthnow)) { |
|
| 1838 | - $daynow -= 7 * 60 * 60 * 24; |
|
| 1839 | - } |
|
| 1840 | - |
|
| 1841 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1842 | - } else if ($this->recur['regen']) { |
|
| 1843 | - $year_starttime = $this->gmtime($now); |
|
| 1844 | - $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
| 1845 | - $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /*year in seconds*/); |
|
| 1846 | - |
|
| 1847 | - if ($now <= $dayend) { |
|
| 1848 | - $this->processOccurrenceItem($items, $daystart, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1849 | - } |
|
| 1850 | - } |
|
| 1851 | - } |
|
| 1787 | + if ($daynow <= $dayend && $daynow >= $daystart){ |
|
| 1788 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz , $remindersonly); |
|
| 1789 | + } |
|
| 1790 | + } else if ($this->recur['regen']) { |
|
| 1791 | + $next_month_start = $now + ($this->daysInMonth($now, 1) * 24 * 60 * 60); |
|
| 1792 | + $now = $daystart +($this->daysInMonth($next_month_start, $this->recur['everyn']) * 24 * 60 * 60); |
|
| 1793 | + |
|
| 1794 | + if ($now <= $dayend) { |
|
| 1795 | + $this->processOccurrenceItem($items, $daystart, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1796 | + } |
|
| 1797 | + } |
|
| 1798 | + } |
|
| 1799 | + break; |
|
| 1800 | + case 13: |
|
| 1801 | + // Yearly |
|
| 1802 | + if($this->recur["everyn"] <= 0) |
|
| 1803 | + $this->recur["everyn"] = 12; |
|
| 1804 | + |
|
| 1805 | + for($now = $this->yearStartOf($daystart); $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += $this->daysInMonth($now, $this->recur["everyn"]) * 24 * 60 * 60 ) |
|
| 1806 | + { |
|
| 1807 | + if(isset($this->recur["monthday"]) && !$this->recur['regen']) { // same as monthly, but in a specific month |
|
| 1808 | + // recur["month"] is in minutes since the beginning of the year |
|
| 1809 | + $month = $this->monthOfYear($this->recur["month"]); // $month is now month of year [0..11] |
|
| 1810 | + $monthday = $this->recur["monthday"]; // $monthday is day of the month [1..31] |
|
| 1811 | + $monthstart = $now + $this->daysInMonth($now, $month) * 24 * 60 * 60; // $monthstart is the timestamp of the beginning of the month |
|
| 1812 | + if($monthday > $this->daysInMonth($monthstart, 1)) |
|
| 1813 | + $monthday = $this->daysInMonth($monthstart, 1); // Cap $monthday on month length (eg 28 feb instead of 29 feb) |
|
| 1814 | + $daynow = $monthstart + ($monthday-1) * 24 * 60 * 60; |
|
| 1815 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1816 | + } |
|
| 1817 | + else if(isset($this->recur["nday"]) && isset($this->recur["weekdays"])) { // Nth [weekday] in month X of every N years |
|
| 1818 | + |
|
| 1819 | + // Go the correct month |
|
| 1820 | + $monthnow = $now + $this->daysInMonth($now, $this->monthOfYear($this->recur["month"])) * 24 * 60 * 60; |
|
| 1821 | + |
|
| 1822 | + // Find first matching weekday in this month |
|
| 1823 | + for($wday = 0; $wday < 7; $wday++) |
|
| 1824 | + { |
|
| 1825 | + $daynow = $monthnow + $wday * 60 * 60 * 24; |
|
| 1826 | + $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1827 | + |
|
| 1828 | + if($this->recur["weekdays"] & (1 << $nowtime["tm_wday"])) { // Selected ? |
|
| 1829 | + $firstday = $wday; |
|
| 1830 | + break; |
|
| 1831 | + } |
|
| 1832 | + } |
|
| 1833 | + |
|
| 1834 | + // Same as above (monthly) |
|
| 1835 | + $daynow = $monthnow + ($firstday + ($this->recur["nday"]-1)*7) * 60 * 60 * 24; |
|
| 1836 | + |
|
| 1837 | + while($this->monthStartOf($daynow) != $this->monthStartOf($monthnow)) { |
|
| 1838 | + $daynow -= 7 * 60 * 60 * 24; |
|
| 1839 | + } |
|
| 1840 | + |
|
| 1841 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1842 | + } else if ($this->recur['regen']) { |
|
| 1843 | + $year_starttime = $this->gmtime($now); |
|
| 1844 | + $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
| 1845 | + $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /*year in seconds*/); |
|
| 1846 | + |
|
| 1847 | + if ($now <= $dayend) { |
|
| 1848 | + $this->processOccurrenceItem($items, $daystart, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
|
| 1849 | + } |
|
| 1850 | + } |
|
| 1851 | + } |
|
| 1852 | 1852 | } |
| 1853 | 1853 | //to get all exception items |
| 1854 | 1854 | if (!empty($this->recur['changed_occurrences'])) |
@@ -657,18 +657,18 @@ |
||
| 657 | 657 | $e->setHandled(); |
| 658 | 658 | $props = mapi_getprops($store, array(PR_DISPLAY_NAME)); |
| 659 | 659 | switch($e->getCode()) { |
| 660 | - case MAPI_E_NO_ACCESS: |
|
| 661 | - $msg = "Unable to open FINDER_ROOT for store: %s."; |
|
| 662 | - error_log(sprintf($msg, $props[PR_DISPLAY_NAME])); |
|
| 663 | - break; |
|
| 664 | - case MAPI_E_NOT_FOUND: |
|
| 665 | - $msg = "Unable to open FINDER_ROOT for store: %s. Folder not found."; |
|
| 666 | - error_log(sprintf($msg, $props[PR_DISPLAY_NAME])); |
|
| 667 | - break; |
|
| 668 | - default: |
|
| 669 | - $msg = "Unable to open FINDER_ROOT for store: %s. Unknown MAPI Error %s."; |
|
| 670 | - error_log(sprintf($msg, $props[PR_DISPLAY_NAME], get_mapi_error_name($e->getCode()))); |
|
| 671 | - break; |
|
| 660 | + case MAPI_E_NO_ACCESS: |
|
| 661 | + $msg = "Unable to open FINDER_ROOT for store: %s."; |
|
| 662 | + error_log(sprintf($msg, $props[PR_DISPLAY_NAME])); |
|
| 663 | + break; |
|
| 664 | + case MAPI_E_NOT_FOUND: |
|
| 665 | + $msg = "Unable to open FINDER_ROOT for store: %s. Folder not found."; |
|
| 666 | + error_log(sprintf($msg, $props[PR_DISPLAY_NAME])); |
|
| 667 | + break; |
|
| 668 | + default: |
|
| 669 | + $msg = "Unable to open FINDER_ROOT for store: %s. Unknown MAPI Error %s."; |
|
| 670 | + error_log(sprintf($msg, $props[PR_DISPLAY_NAME], get_mapi_error_name($e->getCode()))); |
|
| 671 | + break; |
|
| 672 | 672 | } |
| 673 | 673 | } |
| 674 | 674 | } |
@@ -307,37 +307,37 @@ |
||
| 307 | 307 | $result = true; |
| 308 | 308 | |
| 309 | 309 | switch ($loader) { |
| 310 | - case LOAD_RELEASE: |
|
| 311 | - if (!is_file(BASE_PATH . '/client/grommunio.js')) { |
|
| 312 | - $this->error('<strong>LOAD_RELEASE configured, but no release files found</strong>', $help_msg); |
|
| 313 | - $result = false; |
|
| 314 | - } else if (is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 315 | - $this->error('<strong>LOAD_RELEASE configured, but source files were found</strong>', $help_msg); |
|
| 316 | - $result = false; |
|
| 317 | - } |
|
| 318 | - break; |
|
| 319 | - case LOAD_DEBUG: |
|
| 320 | - if (!is_file(BASE_PATH . '/client/zarafa-debug.js')) { |
|
| 321 | - $this->error('<strong>LOAD_DEBUG configured, but no debug files found</strong>', $help_msg); |
|
| 322 | - $result = false; |
|
| 323 | - } else if (is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 324 | - $this->error('<strong>LOAD_DEBUG configured, but source files were found</strong>', $help_msg); |
|
| 325 | - $result = false; |
|
| 326 | - } |
|
| 327 | - break; |
|
| 328 | - case LOAD_SOURCE: |
|
| 329 | - if (!is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 330 | - $this->error('<strong>LOAD_SOURCE configured, but no source files found</strong>', $help_msg); |
|
| 331 | - $result = false; |
|
| 332 | - } else if (is_file(BASE_PATH . '/client/grommunio.js') || is_file(BASE_PATH . '/client/zarafa-debug.js')) { |
|
| 333 | - $this->error('<strong>LOAD_SOURCE configured, but release & debug file were found</strong>', $help_msg); |
|
| 334 | - $result = false; |
|
| 335 | - } |
|
| 336 | - break; |
|
| 337 | - default: |
|
| 338 | - $this->error('<strong>Unknown \'DEBUG_LOADER\' value: ' . $loader . '</strong>', $help_msg); |
|
| 339 | - $result = false; |
|
| 340 | - break; |
|
| 310 | + case LOAD_RELEASE: |
|
| 311 | + if (!is_file(BASE_PATH . '/client/grommunio.js')) { |
|
| 312 | + $this->error('<strong>LOAD_RELEASE configured, but no release files found</strong>', $help_msg); |
|
| 313 | + $result = false; |
|
| 314 | + } else if (is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 315 | + $this->error('<strong>LOAD_RELEASE configured, but source files were found</strong>', $help_msg); |
|
| 316 | + $result = false; |
|
| 317 | + } |
|
| 318 | + break; |
|
| 319 | + case LOAD_DEBUG: |
|
| 320 | + if (!is_file(BASE_PATH . '/client/zarafa-debug.js')) { |
|
| 321 | + $this->error('<strong>LOAD_DEBUG configured, but no debug files found</strong>', $help_msg); |
|
| 322 | + $result = false; |
|
| 323 | + } else if (is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 324 | + $this->error('<strong>LOAD_DEBUG configured, but source files were found</strong>', $help_msg); |
|
| 325 | + $result = false; |
|
| 326 | + } |
|
| 327 | + break; |
|
| 328 | + case LOAD_SOURCE: |
|
| 329 | + if (!is_dir(BASE_PATH . '/client/zarafa')) { |
|
| 330 | + $this->error('<strong>LOAD_SOURCE configured, but no source files found</strong>', $help_msg); |
|
| 331 | + $result = false; |
|
| 332 | + } else if (is_file(BASE_PATH . '/client/grommunio.js') || is_file(BASE_PATH . '/client/zarafa-debug.js')) { |
|
| 333 | + $this->error('<strong>LOAD_SOURCE configured, but release & debug file were found</strong>', $help_msg); |
|
| 334 | + $result = false; |
|
| 335 | + } |
|
| 336 | + break; |
|
| 337 | + default: |
|
| 338 | + $this->error('<strong>Unknown \'DEBUG_LOADER\' value: ' . $loader . '</strong>', $help_msg); |
|
| 339 | + $result = false; |
|
| 340 | + break; |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | return $result; |
@@ -267,14 +267,14 @@ |
||
| 267 | 267 | // if error in creating search folder then send error to client |
| 268 | 268 | $errorInfo = array(); |
| 269 | 269 | switch(mapi_last_hresult()) { |
| 270 | - case MAPI_E_NO_ACCESS: |
|
| 271 | - $errorInfo["error_message"] = _("Unable to perform search query, no permissions to create search folder."); |
|
| 272 | - break; |
|
| 273 | - case MAPI_E_NOT_FOUND: |
|
| 274 | - $errorInfo["error_message"] = _("Unable to perform search query, search folder not found."); |
|
| 275 | - break; |
|
| 276 | - default: |
|
| 277 | - $errorInfo["error_message"] = _("Unable to perform search query, store might not support searching."); |
|
| 270 | + case MAPI_E_NO_ACCESS: |
|
| 271 | + $errorInfo["error_message"] = _("Unable to perform search query, no permissions to create search folder."); |
|
| 272 | + break; |
|
| 273 | + case MAPI_E_NOT_FOUND: |
|
| 274 | + $errorInfo["error_message"] = _("Unable to perform search query, search folder not found."); |
|
| 275 | + break; |
|
| 276 | + default: |
|
| 277 | + $errorInfo["error_message"] = _("Unable to perform search query, store might not support searching."); |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | $errorInfo["original_error_message"] = _("Error in creating search folder."); |
@@ -157,32 +157,32 @@ discard block |
||
| 157 | 157 | if ($type == RES_CONTENT) { |
| 158 | 158 | $subres = $restriction[1]; |
| 159 | 159 | switch ($subres[ULPROPTAG]) { |
| 160 | - case PR_SUBJECT: |
|
| 161 | - $patterns['subject'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 162 | - break; |
|
| 163 | - case PR_BODY: |
|
| 164 | - $patterns['content'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 165 | - $patterns['attachments'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 166 | - break; |
|
| 167 | - case PR_SENDER_NAME: |
|
| 168 | - $patterns['sender'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 169 | - break; |
|
| 170 | - case PR_SENT_REPRESENTING_NAME: |
|
| 171 | - $patterns['from'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 172 | - break; |
|
| 173 | - case PR_DISPLAY_TO: |
|
| 174 | - case PR_DISPLAY_CC: |
|
| 175 | - $patterns['recipients'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 176 | - break; |
|
| 177 | - case PR_MESSAGE_CLASS: |
|
| 178 | - if (empty($patterns['message_classes'])) { |
|
| 179 | - $patterns['message_classes'] = array(); |
|
| 180 | - } |
|
| 181 | - $patterns['message_classes'][] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 182 | - break; |
|
| 183 | - case PR_DISPLAY_NAME: |
|
| 184 | - $patterns['others'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 185 | - break; |
|
| 160 | + case PR_SUBJECT: |
|
| 161 | + $patterns['subject'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 162 | + break; |
|
| 163 | + case PR_BODY: |
|
| 164 | + $patterns['content'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 165 | + $patterns['attachments'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 166 | + break; |
|
| 167 | + case PR_SENDER_NAME: |
|
| 168 | + $patterns['sender'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 169 | + break; |
|
| 170 | + case PR_SENT_REPRESENTING_NAME: |
|
| 171 | + $patterns['from'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 172 | + break; |
|
| 173 | + case PR_DISPLAY_TO: |
|
| 174 | + case PR_DISPLAY_CC: |
|
| 175 | + $patterns['recipients'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 176 | + break; |
|
| 177 | + case PR_MESSAGE_CLASS: |
|
| 178 | + if (empty($patterns['message_classes'])) { |
|
| 179 | + $patterns['message_classes'] = array(); |
|
| 180 | + } |
|
| 181 | + $patterns['message_classes'][] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 182 | + break; |
|
| 183 | + case PR_DISPLAY_NAME: |
|
| 184 | + $patterns['others'] = $subres[VALUE][$subres[ULPROPTAG]]; |
|
| 185 | + break; |
|
| 186 | 186 | } |
| 187 | 187 | } else if ($type == RES_AND || $type == RES_OR) { |
| 188 | 188 | foreach ($restriction[1] as $subres) { |
@@ -276,14 +276,14 @@ discard block |
||
| 276 | 276 | // if error in creating search folder then send error to client |
| 277 | 277 | $errorInfo = array(); |
| 278 | 278 | switch(mapi_last_hresult()) { |
| 279 | - case MAPI_E_NO_ACCESS: |
|
| 280 | - $errorInfo["error_message"] = _("Unable to perform search query, no permissions to create search folder."); |
|
| 281 | - break; |
|
| 282 | - case MAPI_E_NOT_FOUND: |
|
| 283 | - $errorInfo["error_message"] = _("Unable to perform search query, search folder not found."); |
|
| 284 | - break; |
|
| 285 | - default: |
|
| 286 | - $errorInfo["error_message"] = _("Unable to perform search query, store might not support searching."); |
|
| 279 | + case MAPI_E_NO_ACCESS: |
|
| 280 | + $errorInfo["error_message"] = _("Unable to perform search query, no permissions to create search folder."); |
|
| 281 | + break; |
|
| 282 | + case MAPI_E_NOT_FOUND: |
|
| 283 | + $errorInfo["error_message"] = _("Unable to perform search query, search folder not found."); |
|
| 284 | + break; |
|
| 285 | + default: |
|
| 286 | + $errorInfo["error_message"] = _("Unable to perform search query, store might not support searching."); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | $errorInfo["original_error_message"] = _("Error in creating search folder."); |