Test Failed
Push — master ( 9c2ec6...dea813 )
by
unknown
10:31 queued 01:16
created

getGoidFromUidZero()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 4
c 1
b 1
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
/*
3
 * SPDX-License-Identifier: AGPL-3.0-only
4
 * SPDX-FileCopyrightText: Copyright 2005-2016 Zarafa Deutschland GmbH
5
 * SPDX-FileCopyrightText: Copyright 2020-2022 grommunio GmbH
6
 */
7
8
define('NOERROR', 0);
9
10
// Load all mapi defs
11
mapi_load_mapidefs(1);
0 ignored issues
show
Bug introduced by
The function mapi_load_mapidefs was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

11
/** @scrutinizer ignore-call */ 
12
mapi_load_mapidefs(1);
Loading history...
12
13
/**
14
 * Function to make a MAPIGUID from a php string.
15
 * The C++ definition for the GUID is:
16
 *  typedef struct _GUID
17
 *  {
18
 *   unsigned long        Data1;
19
 *   unsigned short       Data2;
20
 *   unsigned short       Data3;
21
 *   unsigned char        Data4[8];
22
 *  } GUID;.
23
 *
24
 * A GUID is normally represented in the following form:
25
 * 	{00062008-0000-0000-C000-000000000046}
26
 *
27
 * @param string $guid
28
 *
29
 * @return false|string
30
 */
31
function makeGuid($guid) {
32
	return pack("vvvv", hexdec(substr($guid, 5, 4)), hexdec(substr($guid, 1, 4)), hexdec(substr($guid, 10, 4)), hexdec(substr($guid, 15, 4))) . hex2bin(substr($guid, 20, 4)) . hex2bin(substr($guid, 25, 12));
33
}
34
35
/**
36
 * Function to get a human readable string from a MAPI error code.
37
 *
38
 * @param mixed $errcode the MAPI error code, if not given, we use mapi_last_hresult
39
 *
40
 * @return string The defined name for the MAPI error code
41
 */
42
function get_mapi_error_name($errcode = null) {
43
	if ($errcode === null) {
44
		$errcode = mapi_last_hresult();
45
	}
46
47
	if ($errcode !== 0) {
48
		// Retrieve constants categories, MAPI error names are defined in gromox.
49
		foreach (get_defined_constants(true)['Core'] as $key => $value) {
50
			/*
51
			 * If PHP encounters a number beyond the bounds of the integer type,
52
			 * it will be interpreted as a float instead, so when comparing these error codes
53
			 * we have to manually typecast value to integer, so float will be converted in integer,
54
			 * but still its out of bound for integer limit so it will be auto adjusted to minus value
55
			 */
56
			if ($errcode == (int) $value) {
57
				// Check that we have an actual MAPI error or warning definition
58
				$prefix = substr($key, 0, 7);
59
				if ($prefix == "MAPI_E_" || $prefix == "MAPI_W_") {
60
					return $key;
61
				}
62
			}
63
		}
64
	}
65
	else {
66
		return "NOERROR";
67
	}
68
69
	// error code not found, return hex value (this is a fix for 64-bit systems, we can't use the dechex() function for this)
70
	$result = unpack("H*", pack("N", $errcode));
71
72
	return "0x" . $result[1];
73
}
74
75
/**
76
 * Parses properties from an array of strings. Each "string" may be either an ULONG, which is a direct property ID,
77
 * or a string with format "PT_TYPE:{GUID}:StringId" or "PT_TYPE:{GUID}:0xXXXX" for named
78
 * properties.
79
 *
80
 * @param mixed $store
81
 * @param mixed $mapping
82
 *
83
 * @return array
84
 */
85
function getPropIdsFromStrings($store, $mapping) {
86
	$props = [];
87
88
	$ids = ["name" => [], "id" => [], "guid" => [], "type" => []]; // this array stores all the information needed to retrieve a named property
89
	$num = 0;
90
91
	// caching
92
	$guids = [];
93
94
	foreach ($mapping as $name => $val) {
95
		if (is_string($val)) {
96
			$split = explode(":", $val);
97
98
			if (count($split) != 3) { // invalid string, ignore
99
				trigger_error(sprintf("Invalid property: %s \"%s\"", $name, $val), E_USER_NOTICE);
100
101
				continue;
102
			}
103
104
			if (substr($split[2], 0, 2) == "0x") {
105
				$id = hexdec(substr($split[2], 2));
106
			}
107
			elseif (preg_match('/^[1-9][0-9]{0,12}$/', $split[2])) {
108
				$id = (int) $split[2];
109
			}
110
			else {
111
				$id = $split[2];
112
			}
113
114
			// have we used this guid before?
115
			if (!defined($split[1])) {
116
				if (!array_key_exists($split[1], $guids)) {
117
					$guids[$split[1]] = makeguid($split[1]);
118
				}
119
				$guid = $guids[$split[1]];
120
			}
121
			else {
122
				$guid = constant($split[1]);
123
			}
124
125
			// temp store info about named prop, so we have to call mapi_getidsfromnames just one time
126
			$ids["name"][$num] = $name;
127
			$ids["id"][$num] = $id;
128
			$ids["guid"][$num] = $guid;
129
			$ids["type"][$num] = $split[0];
130
			++$num;
131
		}
132
		else {
133
			// not a named property
134
			$props[$name] = $val;
135
		}
136
	}
137
138
	if (empty($ids["id"])) {
139
		return $props;
140
	}
141
142
	// get the ids
143
	$named = mapi_getidsfromnames($store, $ids["id"], $ids["guid"]);
0 ignored issues
show
Bug introduced by
The function mapi_getidsfromnames was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

143
	$named = /** @scrutinizer ignore-call */ mapi_getidsfromnames($store, $ids["id"], $ids["guid"]);
Loading history...
144
	foreach ($named as $num => $prop) {
145
		$props[$ids["name"][$num]] = mapi_prop_tag(constant($ids["type"][$num]), mapi_prop_id($prop));
0 ignored issues
show
Bug introduced by
The function mapi_prop_id was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

145
		$props[$ids["name"][$num]] = mapi_prop_tag(constant($ids["type"][$num]), /** @scrutinizer ignore-call */ mapi_prop_id($prop));
Loading history...
Bug introduced by
The function mapi_prop_tag was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

145
		$props[$ids["name"][$num]] = /** @scrutinizer ignore-call */ mapi_prop_tag(constant($ids["type"][$num]), mapi_prop_id($prop));
Loading history...
146
	}
147
148
	return $props;
149
}
150
151
/**
152
 * Check whether a call to mapi_getprops returned errors for some properties.
153
 * mapi_getprops function tries to get values of properties requested but somehow if
154
 * if a property value can not be fetched then it changes type of property tag as PT_ERROR
155
 * and returns error for that particular property, probable errors
156
 * that can be returned as value can be MAPI_E_NOT_FOUND, MAPI_E_NOT_ENOUGH_MEMORY.
157
 *
158
 * @param int   $property  Property to check for error
159
 * @param array $propArray An array of properties
160
 *
161
 * @return bool|mixed Gives back false when there is no error, if there is, gives the error
162
 */
163
function propIsError($property, $propArray) {
164
	if (array_key_exists(mapi_prop_tag(PT_ERROR, mapi_prop_id($property)), $propArray)) {
0 ignored issues
show
Bug introduced by
The function mapi_prop_tag was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

164
	if (array_key_exists(/** @scrutinizer ignore-call */ mapi_prop_tag(PT_ERROR, mapi_prop_id($property)), $propArray)) {
Loading history...
Bug introduced by
The function mapi_prop_id was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

164
	if (array_key_exists(mapi_prop_tag(PT_ERROR, /** @scrutinizer ignore-call */ mapi_prop_id($property)), $propArray)) {
Loading history...
165
		return $propArray[mapi_prop_tag(PT_ERROR, mapi_prop_id($property))];
166
	}
167
168
	return false;
169
}
170
171
/**
172
 * Note: Static function, more like a utility function.
173
 *
174
 * Gets all the items (including recurring items) in the specified calendar in the given timeframe. Items are
175
 * included as a whole if they overlap the interval <$start, $end> (non-inclusive). This means that if the interval
176
 * is <08:00 - 14:00>, the item [6:00 - 8:00> is NOT included, nor is the item [14:00 - 16:00>. However, the item
177
 * [7:00 - 9:00> is included as a whole, and is NOT capped to [8:00 - 9:00>.
178
 *
179
 * @param resource $store          The store in which the calendar resides
180
 * @param resource $calendar       The calendar to get the items from
181
 * @param int      $viewstart      Timestamp of beginning of view window
182
 * @param int      $viewend        Timestamp of end of view window
183
 * @param array    $propsrequested Array of properties to return
184
 *
185
 * @return array
186
 */
187
function getCalendarItems($store, $calendar, $viewstart, $viewend, $propsrequested) {
188
	$result = [];
189
	$properties = getPropIdsFromStrings($store, [
190
		"duedate" => "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentEndWhole,
0 ignored issues
show
Bug introduced by
The constant PidLidAppointmentEndWhole was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
191
		"startdate" => "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentStartWhole,
0 ignored issues
show
Bug introduced by
The constant PidLidAppointmentStartWhole was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
192
		"enddate_recurring" => "PT_SYSTIME:PSETID_Appointment:" . PidLidClipEnd,
0 ignored issues
show
Bug introduced by
The constant PidLidClipEnd was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
193
		"recurring" => "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring,
0 ignored issues
show
Bug introduced by
The constant PidLidRecurring was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
194
		"recurring_data" => "PT_BINARY:PSETID_Appointment:" . PidLidAppointmentRecur,
0 ignored issues
show
Bug introduced by
The constant PidLidAppointmentRecur was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
195
		"timezone_data" => "PT_BINARY:PSETID_Appointment:" . PidLidTimeZoneStruct,
0 ignored issues
show
Bug introduced by
The constant PidLidTimeZoneStruct was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
196
		"label" => "PT_LONG:PSETID_Appointment:0x8214",
197
	]);
198
199
	// Create a restriction that will discard rows of appointments that are definitely not in our
200
	// requested time frame
201
202
	$table = mapi_folder_getcontentstable($calendar);
203
204
	$restriction =
205
		// OR
206
		[
207
			RES_OR,
208
			[
209
				[RES_AND,	// Normal items: itemEnd must be after viewStart, itemStart must be before viewEnd
210
					[
211
						[
212
							RES_PROPERTY,
213
							[
214
								RELOP => RELOP_GT,
215
								ULPROPTAG => $properties["duedate"],
216
								VALUE => $viewstart,
217
							],
218
						],
219
						[
220
							RES_PROPERTY,
221
							[
222
								RELOP => RELOP_LT,
223
								ULPROPTAG => $properties["startdate"],
224
								VALUE => $viewend,
225
							],
226
						],
227
					],
228
				],
229
				// OR
230
				[
231
					RES_PROPERTY,
232
					[
233
						RELOP => RELOP_EQ,
234
						ULPROPTAG => $properties["recurring"],
235
						VALUE => true,
236
					],
237
				],
238
			],	// EXISTS OR
239
		];		// global OR
240
241
	// Get requested properties, plus whatever we need
242
	$proplist = [PR_ENTRYID, $properties["recurring"], $properties["recurring_data"], $properties["timezone_data"]];
243
	$proplist = array_merge($proplist, $propsrequested);
244
245
	$rows = mapi_table_queryallrows($table, $proplist, $restriction);
246
247
	// $rows now contains all the items that MAY be in the window; a recurring item needs expansion before including in the output.
248
249
	foreach ($rows as $row) {
250
		$items = [];
251
252
		if (isset($row[$properties["recurring"]]) && $row[$properties["recurring"]]) {
253
			// Recurring item
254
			$rec = new Recurrence($store, $row);
255
256
			// GetItems guarantees that the item overlaps the interval <$viewstart, $viewend>
257
			$occurrences = $rec->getItems($viewstart, $viewend);
258
			foreach ($occurrences as $occurrence) {
259
				// The occurrence takes all properties from the main row, but overrides some properties (like start and end obviously)
260
				$item = $occurrence + $row;
261
				array_push($items, $item);
262
			}
263
		}
264
		else {
265
			// Normal item, it matched the search criteria and therefore overlaps the interval <$viewstart, $viewend>
266
			array_push($items, $row);
267
		}
268
269
		$result = array_merge($result, $items);
270
	}
271
272
	// All items are guaranteed to overlap the interval <$viewstart, $viewend>. Note that we may be returning a few extra
273
	// properties that the caller did not request (recurring, etc). This shouldn't be a problem though.
274
	return $result;
275
}
276
277
/**
278
 * Compares two entryIds. It is possible to have two different entryIds that should match as they
279
 * represent the same object (in multiserver environments).
280
 *
281
 * @param mixed $entryId1 EntryID
282
 * @param mixed $entryId2 EntryID
283
 *
284
 * @return bool Result of the comparison
285
 */
286
function compareEntryIds($entryId1, $entryId2) {
287
	if (!is_string($entryId1) || !is_string($entryId2)) {
288
		return false;
289
	}
290
291
	if ($entryId1 === $entryId2) {
292
		// if normal comparison succeeds then we can directly say that entryids are same
293
		return true;
294
	}
295
296
	return false;
297
}
298
299
/**
300
 * Creates a goid from an ical uuid.
301
 *
302
 * @param string $uid
303
 *
304
 * @return string binary string representation of goid
305
 */
306
function getGoidFromUid($uid) {
307
	return hex2bin("040000008200E00074C5B7101A82E0080000000000000000000000000000000000000000" .
308
				bin2hex(pack("V", 12 + strlen($uid)) . "vCal-Uid" . pack("V", 1) . $uid));
309
}
310
311
	/**
312
	 * Returns zero terminated goid. It is required for backwards compatibility.
313
	 * 
314
	 *
315
	 * @param string $icalUid an appointment uid as HEX
316
	 *
317
	 * @return string an OL compatible GlobalObjectID
318
	 */
319
	function getGoidFromUidZero($uid) {
320
		if (strlen($uid) <= 64) {
321
			return hex2bin("040000008200E00074C5B7101A82E0080000000000000000000000000000000000000000" .
322
				bin2hex(pack("V", 13 + strlen($uid)) . "vCal-Uid" . pack("V", 1) . $uid) . "00");
323
		}
324
325
		return hex2bin($uid);
326
	}
327
328
/**
329
 * Creates an ical uuid from a goid.
330
 *
331
 * @param string $goid
332
 *
333
 * @return null|string ical uuid
334
 */
335
function getUidFromGoid($goid) {
336
	// check if "vCal-Uid" is somewhere in outlookid case-insensitive
337
	$uid = stristr($goid, "vCal-Uid");
338
	if ($uid !== false) {
339
		// get the length of the ical id - go back 4 position from where "vCal-Uid" was found
340
		$begin = unpack("V", substr($goid, strlen($uid) * (-1) - 4, 4));
341
		// remove "vCal-Uid" and packed "1" and use the ical id length
342
		return trim(substr($uid, 12, $begin[1] - 12));
343
	}
344
345
	return null;
346
}
347
348
/**
349
 * Returns an error message from error code.
350
 *
351
 * @param int $e error code
352
 *
353
 * @return string error message
354
 */
355
function mapi_strerror($e) {
356
	switch ($e) {
357
		case 0: return "success";
358
359
		case MAPI_E_CALL_FAILED: return "An error of unexpected or unknown origin occurred";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_CALL_FAILED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
360
361
		case MAPI_E_NOT_ENOUGH_MEMORY: return "Not enough memory was available to complete the operation";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NOT_ENOUGH_MEMORY was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
362
363
		case MAPI_E_INVALID_PARAMETER: return "An invalid parameter was passed to a function or remote procedure call";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_INVALID_PARAMETER was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
364
365
		case MAPI_E_INTERFACE_NOT_SUPPORTED: return "MAPI interface not supported";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_INTERFACE_NOT_SUPPORTED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
366
367
		case MAPI_E_NO_ACCESS: return "An attempt was made to access a message store or object for which the user has insufficient permissions";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NO_ACCESS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
368
369
		case MAPI_E_NO_SUPPORT: return "Function is not implemented";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NO_SUPPORT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
370
371
		case MAPI_E_BAD_CHARWIDTH: return "An incompatibility exists in the character sets supported by the caller and the implementation";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_BAD_CHARWIDTH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
372
373
		case MAPI_E_STRING_TOO_LONG: return "In the context of this method call, a string exceeds the maximum permitted length";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_STRING_TOO_LONG was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
374
375
		case MAPI_E_UNKNOWN_FLAGS: return "One or more values for a flags parameter were not valid";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNKNOWN_FLAGS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
376
377
		case MAPI_E_INVALID_ENTRYID: return "invalid entryid";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_INVALID_ENTRYID was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
378
379
		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";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_INVALID_OBJECT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
380
381
		case MAPI_E_OBJECT_CHANGED: return "An attempt to commit changes failed because the object was changed separately";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_OBJECT_CHANGED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
382
383
		case MAPI_E_OBJECT_DELETED: return "An operation failed because the object was deleted separately";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_OBJECT_DELETED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
384
385
		case MAPI_E_BUSY: return "A table operation failed because a separate operation was in progress at the same time";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_BUSY was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
386
387
		case MAPI_E_NOT_ENOUGH_DISK: return "Not enough disk space was available to complete the operation";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NOT_ENOUGH_DISK was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
388
389
		case MAPI_E_NOT_ENOUGH_RESOURCES: return "Not enough system resources were available to complete the operation";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NOT_ENOUGH_RESOURCES was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
390
391
		case MAPI_E_NOT_FOUND: return "The requested object could not be found at the server";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NOT_FOUND was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
392
393
		case MAPI_E_VERSION: return "Client and server versions are not compatible";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_VERSION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
394
395
		case MAPI_E_LOGON_FAILED: return "A client was unable to log on to the server";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_LOGON_FAILED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
396
397
		case MAPI_E_SESSION_LIMIT: return "A server or service is unable to create any more sessions";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_SESSION_LIMIT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
398
399
		case MAPI_E_USER_CANCEL: return "An operation failed because a user cancelled it";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_USER_CANCEL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
400
401
		case MAPI_E_UNABLE_TO_ABORT: return "A ropAbort or ropAbortSubmit ROP request was unsuccessful";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNABLE_TO_ABORT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
402
403
		case MAPI_E_NETWORK_ERROR: return "An operation was unsuccessful because of a problem with network operations or services";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NETWORK_ERROR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
404
405
		case MAPI_E_DISK_ERROR: return "There was a problem writing to or reading from disk";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_DISK_ERROR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
406
407
		case MAPI_E_TOO_COMPLEX: return "The operation requested is too complex for the server to handle (often w.r.t. restrictions)";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_TOO_COMPLEX was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
408
409
		case MAPI_E_BAD_COLUMN: return "The column requested is not allowed in this type of table";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_BAD_COLUMN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
410
411
		case MAPI_E_EXTENDED_ERROR: return "extended error";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_EXTENDED_ERROR was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
412
413
		case MAPI_E_COMPUTED: return "A property cannot be updated because it is read-only, computed by the server";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_COMPUTED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
414
415
		case MAPI_E_CORRUPT_DATA: return "There is an internal inconsistency in a database, or in a complex property value";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_CORRUPT_DATA was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
416
417
		case MAPI_E_UNCONFIGURED: return "unconfigured";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNCONFIGURED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
418
419
		case MAPI_E_FAILONEPROVIDER: return "failoneprovider";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_FAILONEPROVIDER was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
420
421
		case MAPI_E_UNKNOWN_CPID: return "The server is not configured to support the code page requested by the client";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNKNOWN_CPID was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
422
423
		case MAPI_E_UNKNOWN_LCID: return "The server is not configured to support the locale requested by the client";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNKNOWN_LCID was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
424
425
		case MAPI_E_PASSWORD_CHANGE_REQUIRED: return "password change required";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_PASSWORD_CHANGE_REQUIRED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
426
427
		case MAPI_E_PASSWORD_EXPIRED: return "password expired";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_PASSWORD_EXPIRED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
428
429
		case MAPI_E_INVALID_WORKSTATION_ACCOUNT: return "invalid workstation account";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_INVALID_WORKSTATION_ACCOUNT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
430
431
		case MAPI_E_INVALID_ACCESS_TIME: return "The operation failed due to clock skew between servers";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_INVALID_ACCESS_TIME was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
432
433
		case MAPI_E_ACCOUNT_DISABLED: return "account disabled";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_ACCOUNT_DISABLED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
434
435
		case MAPI_E_END_OF_SESSION: return "The server session has been destroyed, possibly by a server restart";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_END_OF_SESSION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
436
437
		case MAPI_E_UNKNOWN_ENTRYID: return "The EntryID passed to OpenEntry was created by a different MAPI provider";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNKNOWN_ENTRYID was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
438
439
		case MAPI_E_MISSING_REQUIRED_COLUMN: return "missing required column";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_MISSING_REQUIRED_COLUMN was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
440
441
		case MAPI_W_NO_SERVICE: return "no service";
0 ignored issues
show
Bug introduced by
The constant MAPI_W_NO_SERVICE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
442
443
		case MAPI_E_BAD_VALUE: return "bad value";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_BAD_VALUE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
444
445
		case MAPI_E_INVALID_TYPE: return "invalid type";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_INVALID_TYPE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
446
447
		case MAPI_E_TYPE_NO_SUPPORT: return "type no support";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_TYPE_NO_SUPPORT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
448
449
		case MAPI_E_UNEXPECTED_TYPE: return "unexpected_type";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNEXPECTED_TYPE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
450
451
		case MAPI_E_TOO_BIG: return "The table is too big for the requested operation to complete";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_TOO_BIG was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
452
453
		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";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_DECLINE_COPY was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
454
455
		case MAPI_E_UNEXPECTED_ID: return "unexpected id";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNEXPECTED_ID was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
456
457
		case MAPI_W_ERRORS_RETURNED: return "The call succeeded, but the message store provider has error information available";
0 ignored issues
show
Bug introduced by
The constant MAPI_W_ERRORS_RETURNED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
458
459
		case MAPI_E_UNABLE_TO_COMPLETE: return "A complex operation such as building a table row set could not be completed";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_UNABLE_TO_COMPLETE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
460
461
		case MAPI_E_TIMEOUT: return "An asynchronous operation did not succeed within the specified time-out";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_TIMEOUT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
462
463
		case MAPI_E_TABLE_EMPTY: return "A table essential to the operation is empty";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_TABLE_EMPTY was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
464
465
		case MAPI_E_TABLE_TOO_BIG: return "The table is too big for the requested operation to complete";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_TABLE_TOO_BIG was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
466
467
		case MAPI_E_INVALID_BOOKMARK: return "The bookmark passed to a table operation was not created on the same table";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_INVALID_BOOKMARK was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
468
469
		case MAPI_W_POSITION_CHANGED: return "position changed";
0 ignored issues
show
Bug introduced by
The constant MAPI_W_POSITION_CHANGED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
470
471
		case MAPI_W_APPROX_COUNT: return "approx count";
0 ignored issues
show
Bug introduced by
The constant MAPI_W_APPROX_COUNT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
472
473
		case MAPI_E_WAIT: return "A wait time-out has expired";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_WAIT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
474
475
		case MAPI_E_CANCEL: return "The operation had to be canceled";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_CANCEL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
476
477
		case MAPI_E_NOT_ME: return "not me";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NOT_ME was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
478
479
		case MAPI_W_CANCEL_MESSAGE: return "cancel message";
0 ignored issues
show
Bug introduced by
The constant MAPI_W_CANCEL_MESSAGE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
480
481
		case MAPI_E_CORRUPT_STORE: return "corrupt store";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_CORRUPT_STORE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
482
483
		case MAPI_E_NOT_IN_QUEUE: return "not in queue";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NOT_IN_QUEUE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
484
485
		case MAPI_E_NO_SUPPRESS: return "The server does not support the suppression of read receipts";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NO_SUPPRESS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
486
487
		case MAPI_E_COLLISION: return "A folder or item cannot be created because one with the same name or other criteria already exists";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_COLLISION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
488
489
		case MAPI_E_NOT_INITIALIZED: return "The subsystem is not ready";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NOT_INITIALIZED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
490
491
		case MAPI_E_NON_STANDARD: return "non standard";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NON_STANDARD was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
492
493
		case MAPI_E_NO_RECIPIENTS: return "A message cannot be sent because it has no recipients";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_NO_RECIPIENTS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
494
495
		case MAPI_E_SUBMITTED: return "A message cannot be opened for modification because it has already been sent";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_SUBMITTED was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
496
497
		case MAPI_E_HAS_FOLDERS: return "A folder cannot be deleted because it still contains subfolders";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_HAS_FOLDERS was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
498
499
		case MAPI_E_HAS_MESSAGES: return "A folder cannot be deleted because it still contains messages";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_HAS_MESSAGES was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
500
501
		case MAPI_E_FOLDER_CYCLE: return "A folder move or copy operation would create a cycle";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_FOLDER_CYCLE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
502
503
		case MAPI_W_PARTIAL_COMPLETION: return "The call succeeded, but not all entries were successfully operated on";
0 ignored issues
show
Bug introduced by
The constant MAPI_W_PARTIAL_COMPLETION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
504
505
		case MAPI_E_AMBIGUOUS_RECIP: return "An unresolved recipient matches more than one directory entry";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_AMBIGUOUS_RECIP was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
506
507
		case MAPI_E_STORE_FULL: return "Store full";
0 ignored issues
show
Bug introduced by
The constant MAPI_E_STORE_FULL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
508
509
		default: return sprintf("%xh", $e);
510
	}
511
}
512