Passed
Push — master ( 34e8da...f497d2 )
by
unknown
06:10 queued 02:50
created
lib/syncobjects/syncrecurrence.php 1 patch
Indentation   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -10,128 +10,128 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 class SyncRecurrence extends SyncObject {
13
-	public $type;
14
-	public $until;
15
-	public $occurrences;
16
-	public $interval;
17
-	public $dayofweek;
18
-	public $dayofmonth;
19
-	public $weekofmonth;
20
-	public $monthofyear;
21
-	public $calendartype;
22
-	public $firstdayofweek;
13
+    public $type;
14
+    public $until;
15
+    public $occurrences;
16
+    public $interval;
17
+    public $dayofweek;
18
+    public $dayofmonth;
19
+    public $weekofmonth;
20
+    public $monthofyear;
21
+    public $calendartype;
22
+    public $firstdayofweek;
23 23
 
24
-	public function __construct() {
25
-		$mapping = [
26
-			// Recurrence type
27
-			// 0 = Recurs daily
28
-			// 1 = Recurs weekly
29
-			// 2 = Recurs monthly
30
-			// 3 = Recurs monthly on the nth day
31
-			// 5 = Recurs yearly
32
-			// 6 = Recurs yearly on the nth day
33
-			SYNC_POOMCAL_TYPE => [
34
-				self::STREAMER_VAR => "type",
35
-				self::STREAMER_CHECKS => [
36
-					self::STREAMER_CHECK_REQUIRED => self::STREAMER_CHECK_SETZERO,
37
-					self::STREAMER_CHECK_ONEVALUEOF => [0, 1, 2, 3, 5, 6],
38
-				],
39
-				self::STREAMER_RONOTIFY => true,
40
-			],
41
-			SYNC_POOMCAL_UNTIL => [
42
-				self::STREAMER_VAR => "until",
43
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE,
44
-				self::STREAMER_RONOTIFY => true,
45
-			],
46
-			SYNC_POOMCAL_OCCURRENCES => [
47
-				self::STREAMER_VAR => "occurrences",
48
-				self::STREAMER_CHECKS => [
49
-					self::STREAMER_CHECK_CMPHIGHER => 0,
50
-					self::STREAMER_CHECK_CMPLOWER => 1000,
51
-				],
52
-				self::STREAMER_RONOTIFY => true,
53
-			],
54
-			SYNC_POOMCAL_INTERVAL => [
55
-				self::STREAMER_VAR => "interval",
56
-				self::STREAMER_CHECKS => [
57
-					self::STREAMER_CHECK_CMPHIGHER => 0,
58
-					self::STREAMER_CHECK_CMPLOWER => 1000,
59
-				],
60
-				self::STREAMER_RONOTIFY => true,
61
-			],
62
-			// DayOfWeek values
63
-			//   1 = Sunday
64
-			//   2 = Monday
65
-			//   4 = Tuesday
66
-			//   8 = Wednesday
67
-			//  16 = Thursday
68
-			//  32 = Friday
69
-			//  62 = Weekdays  // not in spec: daily weekday recurrence
70
-			//  64 = Saturday
71
-			// 127 = The last day of the month. Value valid only in monthly or yearly recurrences.
72
-			// As this is a bitmask, actually all values 0 > x < 128 are allowed
73
-			SYNC_POOMCAL_DAYOFWEEK => [
74
-				self::STREAMER_VAR => "dayofweek",
75
-				self::STREAMER_CHECKS => [
76
-					self::STREAMER_CHECK_CMPHIGHER => 0,
77
-					self::STREAMER_CHECK_CMPLOWER => 128,
78
-				],
79
-				self::STREAMER_RONOTIFY => true,
80
-			],
81
-			// DayOfMonth values
82
-			// 1-31 representing the day
83
-			SYNC_POOMCAL_DAYOFMONTH => [
84
-				self::STREAMER_VAR => "dayofmonth",
85
-				self::STREAMER_CHECKS => [
86
-					self::STREAMER_CHECK_CMPHIGHER => 0,
87
-					self::STREAMER_CHECK_CMPLOWER => 32,
88
-				],
89
-				self::STREAMER_RONOTIFY => true,
90
-			],
91
-			// WeekOfMonth
92
-			// 1-4 = Y st/nd/rd/th week of month
93
-			// 5 = last week of month
94
-			SYNC_POOMCAL_WEEKOFMONTH => [
95
-				self::STREAMER_VAR => "weekofmonth",
96
-				self::STREAMER_CHECKS => [self::STREAMER_CHECK_ONEVALUEOF => [1, 2, 3, 4, 5]],
97
-				self::STREAMER_RONOTIFY => true,
98
-			],
99
-			// MonthOfYear
100
-			// 1-12 representing the month
101
-			SYNC_POOMCAL_MONTHOFYEAR => [
102
-				self::STREAMER_VAR => "monthofyear",
103
-				self::STREAMER_CHECKS => [self::STREAMER_CHECK_ONEVALUEOF => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]],
104
-				self::STREAMER_RONOTIFY => true,
105
-			],
106
-		];
24
+    public function __construct() {
25
+        $mapping = [
26
+            // Recurrence type
27
+            // 0 = Recurs daily
28
+            // 1 = Recurs weekly
29
+            // 2 = Recurs monthly
30
+            // 3 = Recurs monthly on the nth day
31
+            // 5 = Recurs yearly
32
+            // 6 = Recurs yearly on the nth day
33
+            SYNC_POOMCAL_TYPE => [
34
+                self::STREAMER_VAR => "type",
35
+                self::STREAMER_CHECKS => [
36
+                    self::STREAMER_CHECK_REQUIRED => self::STREAMER_CHECK_SETZERO,
37
+                    self::STREAMER_CHECK_ONEVALUEOF => [0, 1, 2, 3, 5, 6],
38
+                ],
39
+                self::STREAMER_RONOTIFY => true,
40
+            ],
41
+            SYNC_POOMCAL_UNTIL => [
42
+                self::STREAMER_VAR => "until",
43
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE,
44
+                self::STREAMER_RONOTIFY => true,
45
+            ],
46
+            SYNC_POOMCAL_OCCURRENCES => [
47
+                self::STREAMER_VAR => "occurrences",
48
+                self::STREAMER_CHECKS => [
49
+                    self::STREAMER_CHECK_CMPHIGHER => 0,
50
+                    self::STREAMER_CHECK_CMPLOWER => 1000,
51
+                ],
52
+                self::STREAMER_RONOTIFY => true,
53
+            ],
54
+            SYNC_POOMCAL_INTERVAL => [
55
+                self::STREAMER_VAR => "interval",
56
+                self::STREAMER_CHECKS => [
57
+                    self::STREAMER_CHECK_CMPHIGHER => 0,
58
+                    self::STREAMER_CHECK_CMPLOWER => 1000,
59
+                ],
60
+                self::STREAMER_RONOTIFY => true,
61
+            ],
62
+            // DayOfWeek values
63
+            //   1 = Sunday
64
+            //   2 = Monday
65
+            //   4 = Tuesday
66
+            //   8 = Wednesday
67
+            //  16 = Thursday
68
+            //  32 = Friday
69
+            //  62 = Weekdays  // not in spec: daily weekday recurrence
70
+            //  64 = Saturday
71
+            // 127 = The last day of the month. Value valid only in monthly or yearly recurrences.
72
+            // As this is a bitmask, actually all values 0 > x < 128 are allowed
73
+            SYNC_POOMCAL_DAYOFWEEK => [
74
+                self::STREAMER_VAR => "dayofweek",
75
+                self::STREAMER_CHECKS => [
76
+                    self::STREAMER_CHECK_CMPHIGHER => 0,
77
+                    self::STREAMER_CHECK_CMPLOWER => 128,
78
+                ],
79
+                self::STREAMER_RONOTIFY => true,
80
+            ],
81
+            // DayOfMonth values
82
+            // 1-31 representing the day
83
+            SYNC_POOMCAL_DAYOFMONTH => [
84
+                self::STREAMER_VAR => "dayofmonth",
85
+                self::STREAMER_CHECKS => [
86
+                    self::STREAMER_CHECK_CMPHIGHER => 0,
87
+                    self::STREAMER_CHECK_CMPLOWER => 32,
88
+                ],
89
+                self::STREAMER_RONOTIFY => true,
90
+            ],
91
+            // WeekOfMonth
92
+            // 1-4 = Y st/nd/rd/th week of month
93
+            // 5 = last week of month
94
+            SYNC_POOMCAL_WEEKOFMONTH => [
95
+                self::STREAMER_VAR => "weekofmonth",
96
+                self::STREAMER_CHECKS => [self::STREAMER_CHECK_ONEVALUEOF => [1, 2, 3, 4, 5]],
97
+                self::STREAMER_RONOTIFY => true,
98
+            ],
99
+            // MonthOfYear
100
+            // 1-12 representing the month
101
+            SYNC_POOMCAL_MONTHOFYEAR => [
102
+                self::STREAMER_VAR => "monthofyear",
103
+                self::STREAMER_CHECKS => [self::STREAMER_CHECK_ONEVALUEOF => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]],
104
+                self::STREAMER_RONOTIFY => true,
105
+            ],
106
+        ];
107 107
 
108
-		if (Request::GetProtocolVersion() >= 14.0) {
109
-			$mapping[SYNC_POOMCAL_CALENDARTYPE] = [
110
-				self::STREAMER_VAR => "calendartype",
111
-				self::STREAMER_RONOTIFY => true, ];
112
-		}
108
+        if (Request::GetProtocolVersion() >= 14.0) {
109
+            $mapping[SYNC_POOMCAL_CALENDARTYPE] = [
110
+                self::STREAMER_VAR => "calendartype",
111
+                self::STREAMER_RONOTIFY => true, ];
112
+        }
113 113
 
114
-		if (Request::GetProtocolVersion() >= 14.1) {
115
-			// First day of the calendar week for recurrence.
116
-			// FirstDayOfWeek values:
117
-			//   0 = Sunday
118
-			//   1 = Monday
119
-			//   2 = Tuesday
120
-			//   3 = Wednesday
121
-			//   4 = Thursday
122
-			//   5 = Friday
123
-			//   6 = Saturday
124
-			$mapping[SYNC_POOMCAL_FIRSTDAYOFWEEK] = [
125
-				self::STREAMER_VAR => "firstdayofweek",
126
-				self::STREAMER_CHECKS => [self::STREAMER_CHECK_ONEVALUEOF => [0, 1, 2, 3, 4, 5, 6]],
127
-				self::STREAMER_RONOTIFY => true,
128
-			];
129
-		}
114
+        if (Request::GetProtocolVersion() >= 14.1) {
115
+            // First day of the calendar week for recurrence.
116
+            // FirstDayOfWeek values:
117
+            //   0 = Sunday
118
+            //   1 = Monday
119
+            //   2 = Tuesday
120
+            //   3 = Wednesday
121
+            //   4 = Thursday
122
+            //   5 = Friday
123
+            //   6 = Saturday
124
+            $mapping[SYNC_POOMCAL_FIRSTDAYOFWEEK] = [
125
+                self::STREAMER_VAR => "firstdayofweek",
126
+                self::STREAMER_CHECKS => [self::STREAMER_CHECK_ONEVALUEOF => [0, 1, 2, 3, 4, 5, 6]],
127
+                self::STREAMER_RONOTIFY => true,
128
+            ];
129
+        }
130 130
 
131
-		parent::__construct($mapping);
131
+        parent::__construct($mapping);
132 132
 
133
-		// Indicates that this SyncObject supports the private flag and stripping of private data.
134
-		// There is nothing concrete to be stripped here, but as it's part of an appointment it supports it.
135
-		$this->supportsPrivateStripping = true;
136
-	}
133
+        // Indicates that this SyncObject supports the private flag and stripping of private data.
134
+        // There is nothing concrete to be stripped here, but as it's part of an appointment it supports it.
135
+        $this->supportsPrivateStripping = true;
136
+    }
137 137
 }
Please login to merge, or discard this patch.
lib/syncobjects/syncresolverecipientsavailability.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,21 +10,21 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 class SyncResolveRecipientsAvailability extends SyncObject {
13
-	public $starttime;
14
-	public $endtime;
15
-	public $status;
16
-	public $mergedfreebusy;
13
+    public $starttime;
14
+    public $endtime;
15
+    public $status;
16
+    public $mergedfreebusy;
17 17
 
18
-	public function __construct() {
19
-		$mapping = [];
18
+    public function __construct() {
19
+        $mapping = [];
20 20
 
21
-		if (Request::GetProtocolVersion() >= 14.0) {
22
-			$mapping[SYNC_RESOLVERECIPIENTS_STARTTIME] = [self::STREAMER_VAR => "starttime"];
23
-			$mapping[SYNC_RESOLVERECIPIENTS_ENDTIME] = [self::STREAMER_VAR => "endtime"];
24
-			$mapping[SYNC_RESOLVERECIPIENTS_STATUS] = [self::STREAMER_VAR => "status"];
25
-			$mapping[SYNC_RESOLVERECIPIENTS_MERGEDFREEBUSY] = [self::STREAMER_VAR => "mergedfreebusy"];
26
-		}
21
+        if (Request::GetProtocolVersion() >= 14.0) {
22
+            $mapping[SYNC_RESOLVERECIPIENTS_STARTTIME] = [self::STREAMER_VAR => "starttime"];
23
+            $mapping[SYNC_RESOLVERECIPIENTS_ENDTIME] = [self::STREAMER_VAR => "endtime"];
24
+            $mapping[SYNC_RESOLVERECIPIENTS_STATUS] = [self::STREAMER_VAR => "status"];
25
+            $mapping[SYNC_RESOLVERECIPIENTS_MERGEDFREEBUSY] = [self::STREAMER_VAR => "mergedfreebusy"];
26
+        }
27 27
 
28
-		parent::__construct($mapping);
29
-	}
28
+        parent::__construct($mapping);
29
+    }
30 30
 }
Please login to merge, or discard this patch.
lib/syncobjects/syncsendmailsource.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 class SyncSendMailSource extends SyncObject {
13
-	public $folderid;
14
-	public $itemid;
15
-	public $longid;
16
-	public $instanceid;
13
+    public $folderid;
14
+    public $itemid;
15
+    public $longid;
16
+    public $instanceid;
17 17
 
18
-	public function __construct() {
19
-		$mapping = [
20
-			SYNC_COMPOSEMAIL_FOLDERID => [self::STREAMER_VAR => "folderid"],
21
-			SYNC_COMPOSEMAIL_ITEMID => [self::STREAMER_VAR => "itemid"],
22
-			SYNC_COMPOSEMAIL_LONGID => [self::STREAMER_VAR => "longid"],
23
-			SYNC_COMPOSEMAIL_INSTANCEID => [self::STREAMER_VAR => "instanceid"],
24
-		];
18
+    public function __construct() {
19
+        $mapping = [
20
+            SYNC_COMPOSEMAIL_FOLDERID => [self::STREAMER_VAR => "folderid"],
21
+            SYNC_COMPOSEMAIL_ITEMID => [self::STREAMER_VAR => "itemid"],
22
+            SYNC_COMPOSEMAIL_LONGID => [self::STREAMER_VAR => "longid"],
23
+            SYNC_COMPOSEMAIL_INSTANCEID => [self::STREAMER_VAR => "instanceid"],
24
+        ];
25 25
 
26
-		parent::__construct($mapping);
27
-	}
26
+        parent::__construct($mapping);
27
+    }
28 28
 }
Please login to merge, or discard this patch.
lib/syncobjects/syncrightsmanagementtemplates.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,23 +10,23 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 class SyncRightsManagementTemplates extends SyncObject {
13
-	public $rmtemplates;
14
-	public $Status;
13
+    public $rmtemplates;
14
+    public $Status;
15 15
 
16
-	public function __construct() {
17
-		$mapping = [
18
-			SYNC_RIGHTSMANAGEMENT_TEMPLATES => [
19
-				self::STREAMER_VAR => "rmtemplates",
20
-				self::STREAMER_TYPE => "SyncRigtsManagementTemplate",
21
-				self::STREAMER_ARRAY => SYNC_RIGHTSMANAGEMENT_TEMPLATE,
22
-				self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY,
23
-			],
24
-			SYNC_SETTINGS_PROP_STATUS => [
25
-				self::STREAMER_VAR => "Status",
26
-				self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE,
27
-			],
28
-		];
16
+    public function __construct() {
17
+        $mapping = [
18
+            SYNC_RIGHTSMANAGEMENT_TEMPLATES => [
19
+                self::STREAMER_VAR => "rmtemplates",
20
+                self::STREAMER_TYPE => "SyncRigtsManagementTemplate",
21
+                self::STREAMER_ARRAY => SYNC_RIGHTSMANAGEMENT_TEMPLATE,
22
+                self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY,
23
+            ],
24
+            SYNC_SETTINGS_PROP_STATUS => [
25
+                self::STREAMER_VAR => "Status",
26
+                self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE,
27
+            ],
28
+        ];
29 29
 
30
-		parent::__construct($mapping);
31
-	}
30
+        parent::__construct($mapping);
31
+    }
32 32
 }
Please login to merge, or discard this patch.
lib/syncobjects/syncmailflags.php 1 patch
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -10,84 +10,84 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 class SyncMailFlags extends SyncObject {
13
-	public $subject;
14
-	public $flagstatus;
15
-	public $flagtype; // Possible types are clear, complete, active
16
-	public $datecompleted;
17
-	public $completetime;
18
-	public $startdate;
19
-	public $duedate;
20
-	public $utcstartdate;
21
-	public $utcduedate;
22
-	public $reminderset;
23
-	public $remindertime;
24
-	public $ordinaldate;
25
-	public $subordinaldate;
13
+    public $subject;
14
+    public $flagstatus;
15
+    public $flagtype; // Possible types are clear, complete, active
16
+    public $datecompleted;
17
+    public $completetime;
18
+    public $startdate;
19
+    public $duedate;
20
+    public $utcstartdate;
21
+    public $utcduedate;
22
+    public $reminderset;
23
+    public $remindertime;
24
+    public $ordinaldate;
25
+    public $subordinaldate;
26 26
 
27
-	public function __construct() {
28
-		$mapping = [
29
-			SYNC_POOMTASKS_SUBJECT => [
30
-				self::STREAMER_VAR => "subject",
31
-				self::STREAMER_RONOTIFY => true,
32
-			],
33
-			SYNC_POOMMAIL_FLAGSTATUS => [
34
-				self::STREAMER_VAR => "flagstatus",
35
-				self::STREAMER_RONOTIFY => true,
36
-			],
37
-			SYNC_POOMMAIL_FLAGTYPE => [
38
-				self::STREAMER_VAR => "flagtype",
39
-				self::STREAMER_RONOTIFY => true,
40
-			],
41
-			SYNC_POOMTASKS_DATECOMPLETED => [
42
-				self::STREAMER_VAR => "datecompleted",
43
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
44
-				self::STREAMER_RONOTIFY => true,
45
-			],
46
-			SYNC_POOMMAIL_COMPLETETIME => [
47
-				self::STREAMER_VAR => "completetime",
48
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
49
-				self::STREAMER_RONOTIFY => true,
50
-			],
51
-			SYNC_POOMTASKS_STARTDATE => [
52
-				self::STREAMER_VAR => "startdate",
53
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
54
-				self::STREAMER_RONOTIFY => true,
55
-			],
56
-			SYNC_POOMTASKS_DUEDATE => [
57
-				self::STREAMER_VAR => "duedate",
58
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
59
-				self::STREAMER_RONOTIFY => true,
60
-			],
61
-			SYNC_POOMTASKS_UTCSTARTDATE => [
62
-				self::STREAMER_VAR => "utcstartdate",
63
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
64
-				self::STREAMER_RONOTIFY => true,
65
-			],
66
-			SYNC_POOMTASKS_UTCDUEDATE => [
67
-				self::STREAMER_VAR => "utcduedate",
68
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
69
-				self::STREAMER_RONOTIFY => true,
70
-			],
71
-			SYNC_POOMTASKS_REMINDERSET => [
72
-				self::STREAMER_VAR => "reminderset",
73
-				self::STREAMER_RONOTIFY => true,
74
-			],
75
-			SYNC_POOMTASKS_REMINDERTIME => [
76
-				self::STREAMER_VAR => "remindertime",
77
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
78
-				self::STREAMER_RONOTIFY => true,
79
-			],
80
-			SYNC_POOMTASKS_ORDINALDATE => [
81
-				self::STREAMER_VAR => "ordinaldate",
82
-				self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
83
-				self::STREAMER_RONOTIFY => true,
84
-			],
85
-			SYNC_POOMTASKS_SUBORDINALDATE => [
86
-				self::STREAMER_VAR => "subordinaldate",
87
-				self::STREAMER_RONOTIFY => true,
88
-			],
89
-		];
27
+    public function __construct() {
28
+        $mapping = [
29
+            SYNC_POOMTASKS_SUBJECT => [
30
+                self::STREAMER_VAR => "subject",
31
+                self::STREAMER_RONOTIFY => true,
32
+            ],
33
+            SYNC_POOMMAIL_FLAGSTATUS => [
34
+                self::STREAMER_VAR => "flagstatus",
35
+                self::STREAMER_RONOTIFY => true,
36
+            ],
37
+            SYNC_POOMMAIL_FLAGTYPE => [
38
+                self::STREAMER_VAR => "flagtype",
39
+                self::STREAMER_RONOTIFY => true,
40
+            ],
41
+            SYNC_POOMTASKS_DATECOMPLETED => [
42
+                self::STREAMER_VAR => "datecompleted",
43
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
44
+                self::STREAMER_RONOTIFY => true,
45
+            ],
46
+            SYNC_POOMMAIL_COMPLETETIME => [
47
+                self::STREAMER_VAR => "completetime",
48
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
49
+                self::STREAMER_RONOTIFY => true,
50
+            ],
51
+            SYNC_POOMTASKS_STARTDATE => [
52
+                self::STREAMER_VAR => "startdate",
53
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
54
+                self::STREAMER_RONOTIFY => true,
55
+            ],
56
+            SYNC_POOMTASKS_DUEDATE => [
57
+                self::STREAMER_VAR => "duedate",
58
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
59
+                self::STREAMER_RONOTIFY => true,
60
+            ],
61
+            SYNC_POOMTASKS_UTCSTARTDATE => [
62
+                self::STREAMER_VAR => "utcstartdate",
63
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
64
+                self::STREAMER_RONOTIFY => true,
65
+            ],
66
+            SYNC_POOMTASKS_UTCDUEDATE => [
67
+                self::STREAMER_VAR => "utcduedate",
68
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
69
+                self::STREAMER_RONOTIFY => true,
70
+            ],
71
+            SYNC_POOMTASKS_REMINDERSET => [
72
+                self::STREAMER_VAR => "reminderset",
73
+                self::STREAMER_RONOTIFY => true,
74
+            ],
75
+            SYNC_POOMTASKS_REMINDERTIME => [
76
+                self::STREAMER_VAR => "remindertime",
77
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
78
+                self::STREAMER_RONOTIFY => true,
79
+            ],
80
+            SYNC_POOMTASKS_ORDINALDATE => [
81
+                self::STREAMER_VAR => "ordinaldate",
82
+                self::STREAMER_TYPE => self::STREAMER_TYPE_DATE_DASHES,
83
+                self::STREAMER_RONOTIFY => true,
84
+            ],
85
+            SYNC_POOMTASKS_SUBORDINALDATE => [
86
+                self::STREAMER_VAR => "subordinaldate",
87
+                self::STREAMER_RONOTIFY => true,
88
+            ],
89
+        ];
90 90
 
91
-		parent::__construct($mapping);
92
-	}
91
+        parent::__construct($mapping);
92
+    }
93 93
 }
Please login to merge, or discard this patch.
lib/syncobjects/syncsendmail.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -10,42 +10,42 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 class SyncSendMail extends SyncObject {
13
-	public $clientid;
14
-	public $saveinsent;
15
-	public $replacemime;
16
-	public $accountid;
17
-	public $source;
18
-	public $mime;
19
-	public $replyflag;
20
-	public $forwardflag;
13
+    public $clientid;
14
+    public $saveinsent;
15
+    public $replacemime;
16
+    public $accountid;
17
+    public $source;
18
+    public $mime;
19
+    public $replyflag;
20
+    public $forwardflag;
21 21
 
22
-	public function __construct() {
23
-		$mapping = [
24
-			SYNC_COMPOSEMAIL_CLIENTID => [self::STREAMER_VAR => "clientid"],
25
-			SYNC_COMPOSEMAIL_SAVEINSENTITEMS => [
26
-				self::STREAMER_VAR => "saveinsent",
27
-				self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY,
28
-			],
29
-			SYNC_COMPOSEMAIL_REPLACEMIME => [
30
-				self::STREAMER_VAR => "replacemime",
31
-				self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY,
32
-			],
33
-			SYNC_COMPOSEMAIL_ACCOUNTID => [self::STREAMER_VAR => "accountid"],
34
-			SYNC_COMPOSEMAIL_SOURCE => [
35
-				self::STREAMER_VAR => "source",
36
-				self::STREAMER_TYPE => "SyncSendMailSource",
37
-			],
38
-			SYNC_COMPOSEMAIL_MIME => [self::STREAMER_VAR => "mime"],
39
-			SYNC_COMPOSEMAIL_REPLYFLAG => [
40
-				self::STREAMER_VAR => "replyflag",
41
-				self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE,
42
-			],
43
-			SYNC_COMPOSEMAIL_FORWARDFLAG => [
44
-				self::STREAMER_VAR => "forwardflag",
45
-				self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE,
46
-			],
47
-		];
22
+    public function __construct() {
23
+        $mapping = [
24
+            SYNC_COMPOSEMAIL_CLIENTID => [self::STREAMER_VAR => "clientid"],
25
+            SYNC_COMPOSEMAIL_SAVEINSENTITEMS => [
26
+                self::STREAMER_VAR => "saveinsent",
27
+                self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY,
28
+            ],
29
+            SYNC_COMPOSEMAIL_REPLACEMIME => [
30
+                self::STREAMER_VAR => "replacemime",
31
+                self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY,
32
+            ],
33
+            SYNC_COMPOSEMAIL_ACCOUNTID => [self::STREAMER_VAR => "accountid"],
34
+            SYNC_COMPOSEMAIL_SOURCE => [
35
+                self::STREAMER_VAR => "source",
36
+                self::STREAMER_TYPE => "SyncSendMailSource",
37
+            ],
38
+            SYNC_COMPOSEMAIL_MIME => [self::STREAMER_VAR => "mime"],
39
+            SYNC_COMPOSEMAIL_REPLYFLAG => [
40
+                self::STREAMER_VAR => "replyflag",
41
+                self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE,
42
+            ],
43
+            SYNC_COMPOSEMAIL_FORWARDFLAG => [
44
+                self::STREAMER_VAR => "forwardflag",
45
+                self::STREAMER_TYPE => self::STREAMER_TYPE_IGNORE,
46
+            ],
47
+        ];
48 48
 
49
-		parent::__construct($mapping);
50
-	}
49
+        parent::__construct($mapping);
50
+    }
51 51
 }
Please login to merge, or discard this patch.
lib/grommunio/mapimapping.php 1 patch
Indentation   +433 added lines, -433 removed lines patch added patch discarded remove patch
@@ -8,452 +8,452 @@
 block discarded – undo
8 8
  * MAPI to AS mapping class.
9 9
  */
10 10
 class MAPIMapping {
11
-	/**
12
-	 * Returns the MAPI to AS mapping for contacts.
13
-	 *
14
-	 * @return array
15
-	 */
16
-	public static function GetContactMapping() {
17
-		return [
18
-			"anniversary" => PR_WEDDING_ANNIVERSARY,
19
-			"assistantname" => PR_ASSISTANT,
20
-			"assistnamephonenumber" => PR_ASSISTANT_TELEPHONE_NUMBER,
21
-			"birthday" => PR_BIRTHDAY,
22
-			"body" => PR_BODY,
23
-			"business2phonenumber" => PR_BUSINESS2_TELEPHONE_NUMBER,
24
-			"businesscity" => "PT_STRING8:PSETID_Address:0x8046",
25
-			"businesscountry" => "PT_STRING8:PSETID_Address:0x8049",
26
-			"businesspostalcode" => "PT_STRING8:PSETID_Address:0x8048",
27
-			"businessstate" => "PT_STRING8:PSETID_Address:0x8047",
28
-			"businessstreet" => "PT_STRING8:PSETID_Address:0x8045",
29
-			"businessfaxnumber" => PR_BUSINESS_FAX_NUMBER,
30
-			"businessphonenumber" => PR_OFFICE_TELEPHONE_NUMBER,
31
-			"carphonenumber" => PR_CAR_TELEPHONE_NUMBER,
32
-			"categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
33
-			"children" => PR_CHILDRENS_NAMES,
34
-			"companyname" => PR_COMPANY_NAME,
35
-			"department" => PR_DEPARTMENT_NAME,
36
-			"email1address" => "PT_STRING8:PSETID_Address:0x8083",
37
-			"email2address" => "PT_STRING8:PSETID_Address:0x8093",
38
-			"email3address" => "PT_STRING8:PSETID_Address:0x80A3",
39
-			"fileas" => "PT_STRING8:PSETID_Address:0x8005",
40
-			"firstname" => PR_GIVEN_NAME,
41
-			"home2phonenumber" => PR_HOME2_TELEPHONE_NUMBER,
42
-			"homecity" => PR_HOME_ADDRESS_CITY,
43
-			"homecountry" => PR_HOME_ADDRESS_COUNTRY,
44
-			"homepostalcode" => PR_HOME_ADDRESS_POSTAL_CODE,
45
-			"homestate" => PR_HOME_ADDRESS_STATE_OR_PROVINCE,
46
-			"homestreet" => PR_HOME_ADDRESS_STREET,
47
-			"homefaxnumber" => PR_HOME_FAX_NUMBER,
48
-			"homephonenumber" => PR_HOME_TELEPHONE_NUMBER,
49
-			"jobtitle" => PR_TITLE,
50
-			"lastname" => PR_SURNAME,
51
-			"middlename" => PR_MIDDLE_NAME,
52
-			"mobilephonenumber" => PR_CELLULAR_TELEPHONE_NUMBER,
53
-			"officelocation" => PR_OFFICE_LOCATION,
54
-			"othercity" => PR_OTHER_ADDRESS_CITY,
55
-			"othercountry" => PR_OTHER_ADDRESS_COUNTRY,
56
-			"otherpostalcode" => PR_OTHER_ADDRESS_POSTAL_CODE,
57
-			"otherstate" => PR_OTHER_ADDRESS_STATE_OR_PROVINCE,
58
-			"otherstreet" => PR_OTHER_ADDRESS_STREET,
59
-			"pagernumber" => PR_PAGER_TELEPHONE_NUMBER,
60
-			"radiophonenumber" => PR_RADIO_TELEPHONE_NUMBER,
61
-			"spouse" => PR_SPOUSE_NAME,
62
-			"suffix" => PR_GENERATION,
63
-			"title" => PR_DISPLAY_NAME_PREFIX,
64
-			"webpage" => "PT_STRING8:PSETID_Address:0x802b",
65
-			"yomicompanyname" => "PT_STRING8:PSETID_Address:0x802e",
66
-			"yomifirstname" => "PT_STRING8:PSETID_Address:0x802c",
67
-			"yomilastname" => "PT_STRING8:PSETID_Address:0x802d",
68
-			"rtf" => PR_RTF_COMPRESSED,
69
-			// picture
70
-			"customerid" => PR_CUSTOMER_ID,
71
-			"governmentid" => PR_GOVERNMENT_ID_NUMBER,
72
-			"imaddress" => "PT_STRING8:PSETID_Address:0x8062",
73
-			"imaddress2" => "PT_STRING8:PSETID_AirSync:IMAddress2",
74
-			"imaddress3" => "PT_STRING8:PSETID_AirSync:IMAddress3",
75
-			"managername" => PR_MANAGER_NAME,
76
-			"companymainphone" => PR_COMPANY_MAIN_PHONE_NUMBER,
77
-			"accountname" => PR_ACCOUNT,
78
-			"nickname" => PR_NICKNAME,
79
-			// mms
80
-		];
81
-	}
11
+    /**
12
+     * Returns the MAPI to AS mapping for contacts.
13
+     *
14
+     * @return array
15
+     */
16
+    public static function GetContactMapping() {
17
+        return [
18
+            "anniversary" => PR_WEDDING_ANNIVERSARY,
19
+            "assistantname" => PR_ASSISTANT,
20
+            "assistnamephonenumber" => PR_ASSISTANT_TELEPHONE_NUMBER,
21
+            "birthday" => PR_BIRTHDAY,
22
+            "body" => PR_BODY,
23
+            "business2phonenumber" => PR_BUSINESS2_TELEPHONE_NUMBER,
24
+            "businesscity" => "PT_STRING8:PSETID_Address:0x8046",
25
+            "businesscountry" => "PT_STRING8:PSETID_Address:0x8049",
26
+            "businesspostalcode" => "PT_STRING8:PSETID_Address:0x8048",
27
+            "businessstate" => "PT_STRING8:PSETID_Address:0x8047",
28
+            "businessstreet" => "PT_STRING8:PSETID_Address:0x8045",
29
+            "businessfaxnumber" => PR_BUSINESS_FAX_NUMBER,
30
+            "businessphonenumber" => PR_OFFICE_TELEPHONE_NUMBER,
31
+            "carphonenumber" => PR_CAR_TELEPHONE_NUMBER,
32
+            "categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
33
+            "children" => PR_CHILDRENS_NAMES,
34
+            "companyname" => PR_COMPANY_NAME,
35
+            "department" => PR_DEPARTMENT_NAME,
36
+            "email1address" => "PT_STRING8:PSETID_Address:0x8083",
37
+            "email2address" => "PT_STRING8:PSETID_Address:0x8093",
38
+            "email3address" => "PT_STRING8:PSETID_Address:0x80A3",
39
+            "fileas" => "PT_STRING8:PSETID_Address:0x8005",
40
+            "firstname" => PR_GIVEN_NAME,
41
+            "home2phonenumber" => PR_HOME2_TELEPHONE_NUMBER,
42
+            "homecity" => PR_HOME_ADDRESS_CITY,
43
+            "homecountry" => PR_HOME_ADDRESS_COUNTRY,
44
+            "homepostalcode" => PR_HOME_ADDRESS_POSTAL_CODE,
45
+            "homestate" => PR_HOME_ADDRESS_STATE_OR_PROVINCE,
46
+            "homestreet" => PR_HOME_ADDRESS_STREET,
47
+            "homefaxnumber" => PR_HOME_FAX_NUMBER,
48
+            "homephonenumber" => PR_HOME_TELEPHONE_NUMBER,
49
+            "jobtitle" => PR_TITLE,
50
+            "lastname" => PR_SURNAME,
51
+            "middlename" => PR_MIDDLE_NAME,
52
+            "mobilephonenumber" => PR_CELLULAR_TELEPHONE_NUMBER,
53
+            "officelocation" => PR_OFFICE_LOCATION,
54
+            "othercity" => PR_OTHER_ADDRESS_CITY,
55
+            "othercountry" => PR_OTHER_ADDRESS_COUNTRY,
56
+            "otherpostalcode" => PR_OTHER_ADDRESS_POSTAL_CODE,
57
+            "otherstate" => PR_OTHER_ADDRESS_STATE_OR_PROVINCE,
58
+            "otherstreet" => PR_OTHER_ADDRESS_STREET,
59
+            "pagernumber" => PR_PAGER_TELEPHONE_NUMBER,
60
+            "radiophonenumber" => PR_RADIO_TELEPHONE_NUMBER,
61
+            "spouse" => PR_SPOUSE_NAME,
62
+            "suffix" => PR_GENERATION,
63
+            "title" => PR_DISPLAY_NAME_PREFIX,
64
+            "webpage" => "PT_STRING8:PSETID_Address:0x802b",
65
+            "yomicompanyname" => "PT_STRING8:PSETID_Address:0x802e",
66
+            "yomifirstname" => "PT_STRING8:PSETID_Address:0x802c",
67
+            "yomilastname" => "PT_STRING8:PSETID_Address:0x802d",
68
+            "rtf" => PR_RTF_COMPRESSED,
69
+            // picture
70
+            "customerid" => PR_CUSTOMER_ID,
71
+            "governmentid" => PR_GOVERNMENT_ID_NUMBER,
72
+            "imaddress" => "PT_STRING8:PSETID_Address:0x8062",
73
+            "imaddress2" => "PT_STRING8:PSETID_AirSync:IMAddress2",
74
+            "imaddress3" => "PT_STRING8:PSETID_AirSync:IMAddress3",
75
+            "managername" => PR_MANAGER_NAME,
76
+            "companymainphone" => PR_COMPANY_MAIN_PHONE_NUMBER,
77
+            "accountname" => PR_ACCOUNT,
78
+            "nickname" => PR_NICKNAME,
79
+            // mms
80
+        ];
81
+    }
82 82
 
83
-	/**
84
-	 * Returns contact specific MAPI properties.
85
-	 *
86
-	 * @return array
87
-	 */
88
-	public static function GetContactProperties() {
89
-		return [
90
-			"haspic" => "PT_BOOLEAN:PSETID_Address:0x8015",
91
-			"emailaddress1" => "PT_STRING8:PSETID_Address:0x8083",
92
-			"emailaddressdname1" => "PT_STRING8:PSETID_Address:0x8080",
93
-			"emailaddressdemail1" => "PT_STRING8:PSETID_Address:0x8084",
94
-			"emailaddresstype1" => "PT_STRING8:PSETID_Address:0x8082",
95
-			"emailaddressentryid1" => "PT_BINARY:PSETID_Address:0x8085",
96
-			"emailaddress2" => "PT_STRING8:PSETID_Address:0x8093",
97
-			"emailaddressdname2" => "PT_STRING8:PSETID_Address:0x8090",
98
-			"emailaddressdemail2" => "PT_STRING8:PSETID_Address:0x8094",
99
-			"emailaddresstype2" => "PT_STRING8:PSETID_Address:0x8092",
100
-			"emailaddressentryid2" => "PT_BINARY:PSETID_Address:0x8095",
101
-			"emailaddress3" => "PT_STRING8:PSETID_Address:0x80a3",
102
-			"emailaddressdname3" => "PT_STRING8:PSETID_Address:0x80a0",
103
-			"emailaddressdemail3" => "PT_STRING8:PSETID_Address:0x80a4",
104
-			"emailaddresstype3" => "PT_STRING8:PSETID_Address:0x80a2",
105
-			"emailaddressentryid3" => "PT_BINARY:PSETID_Address:0x80a5",
106
-			"addressbookmv" => "PT_MV_LONG:PSETID_Address:0x8028",
107
-			"addressbooklong" => "PT_LONG:PSETID_Address:0x8029",
108
-			"displayname" => PR_DISPLAY_NAME,
109
-			"subject" => PR_SUBJECT,
110
-			"country" => PR_COUNTRY,
111
-			"city" => PR_LOCALITY,
112
-			"postaladdress" => PR_POSTAL_ADDRESS,
113
-			"postalcode" => PR_POSTAL_CODE,
114
-			"state" => PR_STATE_OR_PROVINCE,
115
-			"street" => PR_STREET_ADDRESS,
116
-			"homeaddress" => "PT_STRING8:PSETID_Address:0x801a",
117
-			"businessaddress" => "PT_STRING8:PSETID_Address:0x801b",
118
-			"otheraddress" => "PT_STRING8:PSETID_Address:0x801c",
119
-			"mailingaddress" => "PT_LONG:PSETID_Address:0x8022",
120
-		];
121
-	}
83
+    /**
84
+     * Returns contact specific MAPI properties.
85
+     *
86
+     * @return array
87
+     */
88
+    public static function GetContactProperties() {
89
+        return [
90
+            "haspic" => "PT_BOOLEAN:PSETID_Address:0x8015",
91
+            "emailaddress1" => "PT_STRING8:PSETID_Address:0x8083",
92
+            "emailaddressdname1" => "PT_STRING8:PSETID_Address:0x8080",
93
+            "emailaddressdemail1" => "PT_STRING8:PSETID_Address:0x8084",
94
+            "emailaddresstype1" => "PT_STRING8:PSETID_Address:0x8082",
95
+            "emailaddressentryid1" => "PT_BINARY:PSETID_Address:0x8085",
96
+            "emailaddress2" => "PT_STRING8:PSETID_Address:0x8093",
97
+            "emailaddressdname2" => "PT_STRING8:PSETID_Address:0x8090",
98
+            "emailaddressdemail2" => "PT_STRING8:PSETID_Address:0x8094",
99
+            "emailaddresstype2" => "PT_STRING8:PSETID_Address:0x8092",
100
+            "emailaddressentryid2" => "PT_BINARY:PSETID_Address:0x8095",
101
+            "emailaddress3" => "PT_STRING8:PSETID_Address:0x80a3",
102
+            "emailaddressdname3" => "PT_STRING8:PSETID_Address:0x80a0",
103
+            "emailaddressdemail3" => "PT_STRING8:PSETID_Address:0x80a4",
104
+            "emailaddresstype3" => "PT_STRING8:PSETID_Address:0x80a2",
105
+            "emailaddressentryid3" => "PT_BINARY:PSETID_Address:0x80a5",
106
+            "addressbookmv" => "PT_MV_LONG:PSETID_Address:0x8028",
107
+            "addressbooklong" => "PT_LONG:PSETID_Address:0x8029",
108
+            "displayname" => PR_DISPLAY_NAME,
109
+            "subject" => PR_SUBJECT,
110
+            "country" => PR_COUNTRY,
111
+            "city" => PR_LOCALITY,
112
+            "postaladdress" => PR_POSTAL_ADDRESS,
113
+            "postalcode" => PR_POSTAL_CODE,
114
+            "state" => PR_STATE_OR_PROVINCE,
115
+            "street" => PR_STREET_ADDRESS,
116
+            "homeaddress" => "PT_STRING8:PSETID_Address:0x801a",
117
+            "businessaddress" => "PT_STRING8:PSETID_Address:0x801b",
118
+            "otheraddress" => "PT_STRING8:PSETID_Address:0x801c",
119
+            "mailingaddress" => "PT_LONG:PSETID_Address:0x8022",
120
+        ];
121
+    }
122 122
 
123
-	/**
124
-	 * Returns the MAPI to AS mapping for emails.
125
-	 *
126
-	 * @return array
127
-	 */
128
-	public static function GetEmailMapping() {
129
-		return [
130
-			// from
131
-			"datereceived" => PR_MESSAGE_DELIVERY_TIME,
132
-			"displayname" => PR_SUBJECT,
133
-			"displayto" => PR_DISPLAY_TO,
134
-			"importance" => PR_IMPORTANCE,
135
-			"messageclass" => PR_MESSAGE_CLASS,
136
-			"subject" => PR_SUBJECT,
137
-			"read" => PR_MESSAGE_FLAGS,
138
-			// "to" // need to be generated with SMTP addresses
139
-			// "cc"
140
-			// "threadtopic"        => PR_CONVERSATION_TOPIC,
141
-			"internetcpid" => PR_INTERNET_CPID,
142
-			"nativebodytype" => PR_NATIVE_BODY_INFO,
143
-			"lastverbexecuted" => PR_LAST_VERB_EXECUTED,
144
-			"lastverbexectime" => PR_LAST_VERB_EXECUTION_TIME,
145
-			"categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
146
-		];
147
-	}
123
+    /**
124
+     * Returns the MAPI to AS mapping for emails.
125
+     *
126
+     * @return array
127
+     */
128
+    public static function GetEmailMapping() {
129
+        return [
130
+            // from
131
+            "datereceived" => PR_MESSAGE_DELIVERY_TIME,
132
+            "displayname" => PR_SUBJECT,
133
+            "displayto" => PR_DISPLAY_TO,
134
+            "importance" => PR_IMPORTANCE,
135
+            "messageclass" => PR_MESSAGE_CLASS,
136
+            "subject" => PR_SUBJECT,
137
+            "read" => PR_MESSAGE_FLAGS,
138
+            // "to" // need to be generated with SMTP addresses
139
+            // "cc"
140
+            // "threadtopic"        => PR_CONVERSATION_TOPIC,
141
+            "internetcpid" => PR_INTERNET_CPID,
142
+            "nativebodytype" => PR_NATIVE_BODY_INFO,
143
+            "lastverbexecuted" => PR_LAST_VERB_EXECUTED,
144
+            "lastverbexectime" => PR_LAST_VERB_EXECUTION_TIME,
145
+            "categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
146
+        ];
147
+    }
148 148
 
149
-	/**
150
-	 * Returns email specific MAPI properties.
151
-	 *
152
-	 * @return array
153
-	 */
154
-	public static function GetEmailProperties() {
155
-		return [
156
-			// Override 'From' to show "Full Name <[email protected]>"
157
-			"representingname" => PR_SENT_REPRESENTING_NAME,
158
-			"representingentryid" => PR_SENT_REPRESENTING_ENTRYID,
159
-			"representingsearchkey" => PR_SENT_REPRESENTING_SEARCH_KEY,
160
-			"sourcekey" => PR_SOURCE_KEY,
161
-			"entryid" => PR_ENTRYID,
162
-			"parentsourcekey" => PR_PARENT_SOURCE_KEY,
163
-			"body" => PR_BODY,
164
-			"rtfcompressed" => PR_RTF_COMPRESSED,
165
-			"html" => PR_HTML,
166
-			"rtfinsync" => PR_RTF_IN_SYNC,
167
-			"processed" => PR_PROCESSED,
168
-		];
169
-	}
149
+    /**
150
+     * Returns email specific MAPI properties.
151
+     *
152
+     * @return array
153
+     */
154
+    public static function GetEmailProperties() {
155
+        return [
156
+            // Override 'From' to show "Full Name <[email protected]>"
157
+            "representingname" => PR_SENT_REPRESENTING_NAME,
158
+            "representingentryid" => PR_SENT_REPRESENTING_ENTRYID,
159
+            "representingsearchkey" => PR_SENT_REPRESENTING_SEARCH_KEY,
160
+            "sourcekey" => PR_SOURCE_KEY,
161
+            "entryid" => PR_ENTRYID,
162
+            "parentsourcekey" => PR_PARENT_SOURCE_KEY,
163
+            "body" => PR_BODY,
164
+            "rtfcompressed" => PR_RTF_COMPRESSED,
165
+            "html" => PR_HTML,
166
+            "rtfinsync" => PR_RTF_IN_SYNC,
167
+            "processed" => PR_PROCESSED,
168
+        ];
169
+    }
170 170
 
171
-	/**
172
-	 * Returns the MAPI to AS mapping for meeting requests.
173
-	 *
174
-	 * @return array
175
-	 */
176
-	public static function GetMeetingRequestMapping() {
177
-		return [
178
-			"responserequested" => PR_RESPONSE_REQUESTED,
179
-			// timezone
180
-			"alldayevent" => "PT_BOOLEAN:PSETID_Appointment:0x8215",
181
-			"busystatus" => "PT_LONG:PSETID_Appointment:0x8224",
182
-			"rtf" => PR_RTF_COMPRESSED,
183
-			"dtstamp" => PR_LAST_MODIFICATION_TIME,
184
-			"endtime" => "PT_SYSTIME:PSETID_Appointment:0x820e",
185
-			"location" => "PT_STRING8:PSETID_Appointment:0x8208",
186
-			// recurrences
187
-			"reminder" => "PT_LONG:PSETID_Common:0x8501",
188
-			"starttime" => "PT_SYSTIME:PSETID_Appointment:0x820d",
189
-			"sensitivity" => PR_SENSITIVITY,
190
-		];
191
-	}
171
+    /**
172
+     * Returns the MAPI to AS mapping for meeting requests.
173
+     *
174
+     * @return array
175
+     */
176
+    public static function GetMeetingRequestMapping() {
177
+        return [
178
+            "responserequested" => PR_RESPONSE_REQUESTED,
179
+            // timezone
180
+            "alldayevent" => "PT_BOOLEAN:PSETID_Appointment:0x8215",
181
+            "busystatus" => "PT_LONG:PSETID_Appointment:0x8224",
182
+            "rtf" => PR_RTF_COMPRESSED,
183
+            "dtstamp" => PR_LAST_MODIFICATION_TIME,
184
+            "endtime" => "PT_SYSTIME:PSETID_Appointment:0x820e",
185
+            "location" => "PT_STRING8:PSETID_Appointment:0x8208",
186
+            // recurrences
187
+            "reminder" => "PT_LONG:PSETID_Common:0x8501",
188
+            "starttime" => "PT_SYSTIME:PSETID_Appointment:0x820d",
189
+            "sensitivity" => PR_SENSITIVITY,
190
+        ];
191
+    }
192 192
 
193
-	public static function GetMeetingRequestProperties() {
194
-		return [
195
-			"goidtag" => "PT_BINARY:PSETID_Meeting:0x3",
196
-			"timezonetag" => "PT_BINARY:PSETID_Appointment:0x8233",
197
-			"recReplTime" => "PT_SYSTIME:PSETID_Appointment:0x8228",
198
-			"isrecurringtag" => "PT_BOOLEAN:PSETID_Appointment:0x8223",
199
-			"recurringstate" => "PT_BINARY:PSETID_Appointment:0x8216",
200
-			"appSeqNr" => "PT_LONG:PSETID_Appointment:0x8201",
201
-			"lidIsException" => "PT_BOOLEAN:PSETID_Appointment:0xA",
202
-			"recurStartTime" => "PT_LONG:PSETID_Meeting:0xE",
203
-			"reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503",
204
-			"remindertime" => "PT_LONG:PSETID_Common:0x8501",
205
-			"recurrenceend" => "PT_SYSTIME:PSETID_Appointment:0x8236",
206
-			"meetingType" => "PT_LONG:PSETID_Meeting:0x26",
207
-		];
208
-	}
193
+    public static function GetMeetingRequestProperties() {
194
+        return [
195
+            "goidtag" => "PT_BINARY:PSETID_Meeting:0x3",
196
+            "timezonetag" => "PT_BINARY:PSETID_Appointment:0x8233",
197
+            "recReplTime" => "PT_SYSTIME:PSETID_Appointment:0x8228",
198
+            "isrecurringtag" => "PT_BOOLEAN:PSETID_Appointment:0x8223",
199
+            "recurringstate" => "PT_BINARY:PSETID_Appointment:0x8216",
200
+            "appSeqNr" => "PT_LONG:PSETID_Appointment:0x8201",
201
+            "lidIsException" => "PT_BOOLEAN:PSETID_Appointment:0xA",
202
+            "recurStartTime" => "PT_LONG:PSETID_Meeting:0xE",
203
+            "reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503",
204
+            "remindertime" => "PT_LONG:PSETID_Common:0x8501",
205
+            "recurrenceend" => "PT_SYSTIME:PSETID_Appointment:0x8236",
206
+            "meetingType" => "PT_LONG:PSETID_Meeting:0x26",
207
+        ];
208
+    }
209 209
 
210
-	public static function GetTnefAndIcalProperties() {
211
-		return [
212
-			"starttime" => "PT_SYSTIME:PSETID_Appointment:0x820d",
213
-			"endtime" => "PT_SYSTIME:PSETID_Appointment:0x820e",
214
-			"commonstart" => "PT_SYSTIME:PSETID_Common:0x8516",
215
-			"commonend" => "PT_SYSTIME:PSETID_Common:0x8517",
216
-			"clipstart" => "PT_SYSTIME:PSETID_Appointment:0x8235", // ical only
217
-			"recurrenceend" => "PT_SYSTIME:PSETID_Appointment:0x8236", // ical only
218
-			"isrecurringtag" => "PT_BOOLEAN:PSETID_Appointment:0x8223",
219
-			"goidtag" => "PT_BINARY:PSETID_Meeting:0x3",
220
-			"goid2tag" => "PT_BINARY:PSETID_Meeting:0x23",
221
-			"usetnef" => "PT_LONG:PSETID_Meeting:0x8582",
222
-			"tneflocation" => "PT_STRING8:PSETID_Meeting:0x2", // ical only
223
-			"location" => "PT_STRING8:PSETID_Appointment:0x8208",
224
-			"tnefrecurr" => "PT_BOOLEAN:PSETID_Meeting:0x5",
225
-			"sideeffects" => "PT_LONG:PSETID_Common:0x8510",
226
-			"type" => "PT_STRING8:PSETID_Meeting:0x24",
227
-			"busystatus" => "PT_LONG:PSETID_Appointment:0x8205",
228
-			"meetingstatus" => "PT_LONG:PSETID_Appointment:0x8217",
229
-			"responsestatus" => "PT_LONG:PSETID_Meeting:0x8218",
230
-			// the properties below are currently not used
231
-			"dayinterval" => "PT_I2:PSETID_Meeting:0x11",
232
-			"weekinterval" => "PT_I2:PSETID_Meeting:0x12",
233
-			"monthinterval" => "PT_I2:PSETID_Meeting:0x13",
234
-			"yearinterval" => "PT_I2:PSETID_Meeting:0x14",
235
-		];
236
-	}
210
+    public static function GetTnefAndIcalProperties() {
211
+        return [
212
+            "starttime" => "PT_SYSTIME:PSETID_Appointment:0x820d",
213
+            "endtime" => "PT_SYSTIME:PSETID_Appointment:0x820e",
214
+            "commonstart" => "PT_SYSTIME:PSETID_Common:0x8516",
215
+            "commonend" => "PT_SYSTIME:PSETID_Common:0x8517",
216
+            "clipstart" => "PT_SYSTIME:PSETID_Appointment:0x8235", // ical only
217
+            "recurrenceend" => "PT_SYSTIME:PSETID_Appointment:0x8236", // ical only
218
+            "isrecurringtag" => "PT_BOOLEAN:PSETID_Appointment:0x8223",
219
+            "goidtag" => "PT_BINARY:PSETID_Meeting:0x3",
220
+            "goid2tag" => "PT_BINARY:PSETID_Meeting:0x23",
221
+            "usetnef" => "PT_LONG:PSETID_Meeting:0x8582",
222
+            "tneflocation" => "PT_STRING8:PSETID_Meeting:0x2", // ical only
223
+            "location" => "PT_STRING8:PSETID_Appointment:0x8208",
224
+            "tnefrecurr" => "PT_BOOLEAN:PSETID_Meeting:0x5",
225
+            "sideeffects" => "PT_LONG:PSETID_Common:0x8510",
226
+            "type" => "PT_STRING8:PSETID_Meeting:0x24",
227
+            "busystatus" => "PT_LONG:PSETID_Appointment:0x8205",
228
+            "meetingstatus" => "PT_LONG:PSETID_Appointment:0x8217",
229
+            "responsestatus" => "PT_LONG:PSETID_Meeting:0x8218",
230
+            // the properties below are currently not used
231
+            "dayinterval" => "PT_I2:PSETID_Meeting:0x11",
232
+            "weekinterval" => "PT_I2:PSETID_Meeting:0x12",
233
+            "monthinterval" => "PT_I2:PSETID_Meeting:0x13",
234
+            "yearinterval" => "PT_I2:PSETID_Meeting:0x14",
235
+        ];
236
+    }
237 237
 
238
-	/**
239
-	 * Returns the MAPI to AS mapping for appointments.
240
-	 *
241
-	 * @return array
242
-	 */
243
-	public static function GetAppointmentMapping() {
244
-		return [
245
-			"alldayevent" => "PT_BOOLEAN:PSETID_Appointment:0x8215",
246
-			"body" => PR_BODY,
247
-			"busystatus" => "PT_LONG:PSETID_Appointment:0x8205",
248
-			"categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
249
-			"rtf" => PR_RTF_COMPRESSED,
250
-			"dtstamp" => PR_LAST_MODIFICATION_TIME,
251
-			"endtime" => "PT_SYSTIME:PSETID_Appointment:0x820e",
252
-			"location" => "PT_STRING8:PSETID_Appointment:0x8208",
253
-			"meetingstatus" => "PT_LONG:PSETID_Appointment:0x8217",
254
-			"sensitivity" => PR_SENSITIVITY,
255
-			"subject" => PR_SUBJECT,
256
-			"starttime" => "PT_SYSTIME:PSETID_Appointment:0x820d",
257
-			"uid" => "PT_BINARY:PSETID_Meeting:0x3",
258
-			"nativebodytype" => PR_NATIVE_BODY_INFO,
259
-		];
260
-	}
238
+    /**
239
+     * Returns the MAPI to AS mapping for appointments.
240
+     *
241
+     * @return array
242
+     */
243
+    public static function GetAppointmentMapping() {
244
+        return [
245
+            "alldayevent" => "PT_BOOLEAN:PSETID_Appointment:0x8215",
246
+            "body" => PR_BODY,
247
+            "busystatus" => "PT_LONG:PSETID_Appointment:0x8205",
248
+            "categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
249
+            "rtf" => PR_RTF_COMPRESSED,
250
+            "dtstamp" => PR_LAST_MODIFICATION_TIME,
251
+            "endtime" => "PT_SYSTIME:PSETID_Appointment:0x820e",
252
+            "location" => "PT_STRING8:PSETID_Appointment:0x8208",
253
+            "meetingstatus" => "PT_LONG:PSETID_Appointment:0x8217",
254
+            "sensitivity" => PR_SENSITIVITY,
255
+            "subject" => PR_SUBJECT,
256
+            "starttime" => "PT_SYSTIME:PSETID_Appointment:0x820d",
257
+            "uid" => "PT_BINARY:PSETID_Meeting:0x3",
258
+            "nativebodytype" => PR_NATIVE_BODY_INFO,
259
+        ];
260
+    }
261 261
 
262
-	/**
263
-	 * Returns appointment specific MAPI properties.
264
-	 *
265
-	 * @return array
266
-	 */
267
-	public static function GetAppointmentProperties() {
268
-		return [
269
-			"sourcekey" => PR_SOURCE_KEY,
270
-			"representingentryid" => PR_SENT_REPRESENTING_ENTRYID,
271
-			"representingname" => PR_SENT_REPRESENTING_NAME,
272
-			"sentrepresentingemail" => PR_SENT_REPRESENTING_EMAIL_ADDRESS,
273
-			"sentrepresentingaddt" => PR_SENT_REPRESENTING_ADDRTYPE,
274
-			"sentrepresentinsrchk" => PR_SENT_REPRESENTING_SEARCH_KEY,
275
-			"reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503",
276
-			"remindertime" => "PT_LONG:PSETID_Common:0x8501",
277
-			"meetingstatus" => "PT_LONG:PSETID_Appointment:0x8217",
278
-			"isrecurring" => "PT_BOOLEAN:PSETID_Appointment:0x8223",
279
-			"recurringstate" => "PT_BINARY:PSETID_Appointment:0x8216",
280
-			"timezonetag" => "PT_BINARY:PSETID_Appointment:0x8233",
281
-			"timezonedesc" => "PT_STRING8:PSETID_Appointment:0x8234",
282
-			"recurrenceend" => "PT_SYSTIME:PSETID_Appointment:0x8236",
283
-			"responsestatus" => "PT_LONG:PSETID_Appointment:0x8218",
284
-			"commonstart" => "PT_SYSTIME:PSETID_Common:0x8516",
285
-			"commonend" => "PT_SYSTIME:PSETID_Common:0x8517",
286
-			"reminderstart" => "PT_SYSTIME:PSETID_Common:0x8502",
287
-			"duration" => "PT_LONG:PSETID_Appointment:0x8213",
288
-			"private" => "PT_BOOLEAN:PSETID_Common:0x8506",
289
-			"uid" => "PT_BINARY:PSETID_Meeting:0x23",
290
-			"sideeffects" => "PT_LONG:PSETID_Common:0x8510",
291
-			"flagdueby" => "PT_SYSTIME:PSETID_Common:0x8560",
292
-			"icon" => PR_ICON_INDEX,
293
-			"mrwassent" => "PT_BOOLEAN:PSETID_Appointment:0x8229",
294
-			"endtime" => "PT_SYSTIME:PSETID_Appointment:0x820e", // this is here for calendar restriction, tnef and ical
295
-			"starttime" => "PT_SYSTIME:PSETID_Appointment:0x820d", // this is here for calendar restriction, tnef and ical
296
-			"clipstart" => "PT_SYSTIME:PSETID_Appointment:0x8235", // ical only
297
-			"recurrencetype" => "PT_LONG:PSETID_Appointment:0x8231",
298
-			"body" => PR_BODY,
299
-			"rtfcompressed" => PR_RTF_COMPRESSED,
300
-			"html" => PR_HTML,
301
-			"rtfinsync" => PR_RTF_IN_SYNC,
302
-		];
303
-	}
262
+    /**
263
+     * Returns appointment specific MAPI properties.
264
+     *
265
+     * @return array
266
+     */
267
+    public static function GetAppointmentProperties() {
268
+        return [
269
+            "sourcekey" => PR_SOURCE_KEY,
270
+            "representingentryid" => PR_SENT_REPRESENTING_ENTRYID,
271
+            "representingname" => PR_SENT_REPRESENTING_NAME,
272
+            "sentrepresentingemail" => PR_SENT_REPRESENTING_EMAIL_ADDRESS,
273
+            "sentrepresentingaddt" => PR_SENT_REPRESENTING_ADDRTYPE,
274
+            "sentrepresentinsrchk" => PR_SENT_REPRESENTING_SEARCH_KEY,
275
+            "reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503",
276
+            "remindertime" => "PT_LONG:PSETID_Common:0x8501",
277
+            "meetingstatus" => "PT_LONG:PSETID_Appointment:0x8217",
278
+            "isrecurring" => "PT_BOOLEAN:PSETID_Appointment:0x8223",
279
+            "recurringstate" => "PT_BINARY:PSETID_Appointment:0x8216",
280
+            "timezonetag" => "PT_BINARY:PSETID_Appointment:0x8233",
281
+            "timezonedesc" => "PT_STRING8:PSETID_Appointment:0x8234",
282
+            "recurrenceend" => "PT_SYSTIME:PSETID_Appointment:0x8236",
283
+            "responsestatus" => "PT_LONG:PSETID_Appointment:0x8218",
284
+            "commonstart" => "PT_SYSTIME:PSETID_Common:0x8516",
285
+            "commonend" => "PT_SYSTIME:PSETID_Common:0x8517",
286
+            "reminderstart" => "PT_SYSTIME:PSETID_Common:0x8502",
287
+            "duration" => "PT_LONG:PSETID_Appointment:0x8213",
288
+            "private" => "PT_BOOLEAN:PSETID_Common:0x8506",
289
+            "uid" => "PT_BINARY:PSETID_Meeting:0x23",
290
+            "sideeffects" => "PT_LONG:PSETID_Common:0x8510",
291
+            "flagdueby" => "PT_SYSTIME:PSETID_Common:0x8560",
292
+            "icon" => PR_ICON_INDEX,
293
+            "mrwassent" => "PT_BOOLEAN:PSETID_Appointment:0x8229",
294
+            "endtime" => "PT_SYSTIME:PSETID_Appointment:0x820e", // this is here for calendar restriction, tnef and ical
295
+            "starttime" => "PT_SYSTIME:PSETID_Appointment:0x820d", // this is here for calendar restriction, tnef and ical
296
+            "clipstart" => "PT_SYSTIME:PSETID_Appointment:0x8235", // ical only
297
+            "recurrencetype" => "PT_LONG:PSETID_Appointment:0x8231",
298
+            "body" => PR_BODY,
299
+            "rtfcompressed" => PR_RTF_COMPRESSED,
300
+            "html" => PR_HTML,
301
+            "rtfinsync" => PR_RTF_IN_SYNC,
302
+        ];
303
+    }
304 304
 
305
-	/**
306
-	 * Returns the MAPI to AS mapping for tasks.
307
-	 *
308
-	 * @return array
309
-	 */
310
-	public static function GetTaskMapping() {
311
-		return [
312
-			"body" => PR_BODY,
313
-			"categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
314
-			"complete" => "PT_BOOLEAN:PSETID_Task:0x811C",
315
-			"datecompleted" => "PT_SYSTIME:PSETID_Task:0x810F",
316
-			"duedate" => "PT_SYSTIME:PSETID_Task:0x8105",
317
-			"utcduedate" => "PT_SYSTIME:PSETID_Common:0x8517",
318
-			"utcstartdate" => "PT_SYSTIME:PSETID_Common:0x8516",
319
-			"importance" => PR_IMPORTANCE,
320
-			// recurrence
321
-			// regenerate
322
-			// deadoccur
323
-			"reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503",
324
-			"remindertime" => "PT_SYSTIME:PSETID_Common:0x8502",
325
-			"sensitivity" => PR_SENSITIVITY,
326
-			"startdate" => "PT_SYSTIME:PSETID_Task:0x8104",
327
-			"subject" => PR_SUBJECT,
328
-			"rtf" => PR_RTF_COMPRESSED,
329
-			"html" => PR_HTML,
330
-		];
331
-	}
305
+    /**
306
+     * Returns the MAPI to AS mapping for tasks.
307
+     *
308
+     * @return array
309
+     */
310
+    public static function GetTaskMapping() {
311
+        return [
312
+            "body" => PR_BODY,
313
+            "categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
314
+            "complete" => "PT_BOOLEAN:PSETID_Task:0x811C",
315
+            "datecompleted" => "PT_SYSTIME:PSETID_Task:0x810F",
316
+            "duedate" => "PT_SYSTIME:PSETID_Task:0x8105",
317
+            "utcduedate" => "PT_SYSTIME:PSETID_Common:0x8517",
318
+            "utcstartdate" => "PT_SYSTIME:PSETID_Common:0x8516",
319
+            "importance" => PR_IMPORTANCE,
320
+            // recurrence
321
+            // regenerate
322
+            // deadoccur
323
+            "reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503",
324
+            "remindertime" => "PT_SYSTIME:PSETID_Common:0x8502",
325
+            "sensitivity" => PR_SENSITIVITY,
326
+            "startdate" => "PT_SYSTIME:PSETID_Task:0x8104",
327
+            "subject" => PR_SUBJECT,
328
+            "rtf" => PR_RTF_COMPRESSED,
329
+            "html" => PR_HTML,
330
+        ];
331
+    }
332 332
 
333
-	/**
334
-	 * Returns task specific MAPI properties.
335
-	 *
336
-	 * @return array
337
-	 */
338
-	public static function GetTaskProperties() {
339
-		return [
340
-			"isrecurringtag" => "PT_BOOLEAN:PSETID_Task:0x8126",
341
-			"recurringstate" => "PT_BINARY:PSETID_Task:0x8116",
342
-			"deadoccur" => "PT_BOOLEAN:PSETID_Task:0x8109",
343
-			"completion" => "PT_DOUBLE:PSETID_Task:0x8102",
344
-			"status" => "PT_LONG:PSETID_Task:0x8101",
345
-			"icon" => PR_ICON_INDEX,
346
-			"owner" => "PT_STRING8:PSETID_Task:0x811F",
347
-			"private" => "PT_BOOLEAN:PSETID_Common:0x8506",
348
-		];
349
-	}
333
+    /**
334
+     * Returns task specific MAPI properties.
335
+     *
336
+     * @return array
337
+     */
338
+    public static function GetTaskProperties() {
339
+        return [
340
+            "isrecurringtag" => "PT_BOOLEAN:PSETID_Task:0x8126",
341
+            "recurringstate" => "PT_BINARY:PSETID_Task:0x8116",
342
+            "deadoccur" => "PT_BOOLEAN:PSETID_Task:0x8109",
343
+            "completion" => "PT_DOUBLE:PSETID_Task:0x8102",
344
+            "status" => "PT_LONG:PSETID_Task:0x8101",
345
+            "icon" => PR_ICON_INDEX,
346
+            "owner" => "PT_STRING8:PSETID_Task:0x811F",
347
+            "private" => "PT_BOOLEAN:PSETID_Common:0x8506",
348
+        ];
349
+    }
350 350
 
351
-	/**
352
-	 * Returns the MAPI to AS mapping for email todo flags.
353
-	 *
354
-	 * @return array
355
-	 */
356
-	public static function GetMailFlagsMapping() {
357
-		return [
358
-			"flagstatus" => PR_FLAG_STATUS,
359
-			"flagtype" => "PT_STRING8:PSETID_Common:0x8530",
360
-			"datecompleted" => "PT_SYSTIME:PSETID_Common:0x810F",
361
-			"completetime" => PR_FLAG_COMPLETE_TIME,
362
-			"startdate" => "PT_SYSTIME:PSETID_Task:0x8104",
363
-			"duedate" => "PT_SYSTIME:PSETID_Task:0x8105",
364
-			"utcstartdate" => "PT_SYSTIME:PSETID_Common:0x8516",
365
-			"utcduedate" => "PT_SYSTIME:PSETID_Common:0x8517",
366
-			"reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503",
367
-			"remindertime" => "PT_SYSTIME:PSETID_Common:0x8502",
368
-			"ordinaldate" => "PT_SYSTIME:PSETID_Common:0x85A0",
369
-			"subordinaldate" => "PT_STRING8:PSETID_Common:0x85A1",
370
-		];
371
-	}
351
+    /**
352
+     * Returns the MAPI to AS mapping for email todo flags.
353
+     *
354
+     * @return array
355
+     */
356
+    public static function GetMailFlagsMapping() {
357
+        return [
358
+            "flagstatus" => PR_FLAG_STATUS,
359
+            "flagtype" => "PT_STRING8:PSETID_Common:0x8530",
360
+            "datecompleted" => "PT_SYSTIME:PSETID_Common:0x810F",
361
+            "completetime" => PR_FLAG_COMPLETE_TIME,
362
+            "startdate" => "PT_SYSTIME:PSETID_Task:0x8104",
363
+            "duedate" => "PT_SYSTIME:PSETID_Task:0x8105",
364
+            "utcstartdate" => "PT_SYSTIME:PSETID_Common:0x8516",
365
+            "utcduedate" => "PT_SYSTIME:PSETID_Common:0x8517",
366
+            "reminderset" => "PT_BOOLEAN:PSETID_Common:0x8503",
367
+            "remindertime" => "PT_SYSTIME:PSETID_Common:0x8502",
368
+            "ordinaldate" => "PT_SYSTIME:PSETID_Common:0x85A0",
369
+            "subordinaldate" => "PT_STRING8:PSETID_Common:0x85A1",
370
+        ];
371
+    }
372 372
 
373
-	/**
374
-	 * Returns email todo flags' specific MAPI properties.
375
-	 *
376
-	 * @return array
377
-	 */
378
-	public static function GetMailFlagsProperties() {
379
-		return [
380
-			"todoitemsflags" => PR_TODO_ITEM_FLAGS,
381
-			"todotitle" => "PT_STRING8:PSETID_Common:0x85A4",
382
-			"flagicon" => PR_FLAG_ICON,
383
-			"replyrequested" => PR_REPLY_REQUESTED,
384
-			"responserequested" => PR_RESPONSE_REQUESTED,
385
-			"status" => "PT_LONG:PSETID_Task:0x8101",
386
-			"completion" => "PT_DOUBLE:PSETID_Task:0x8102",
387
-			"complete" => "PT_BOOLEAN:PSETID_Task:0x811C",
388
-		];
389
-	}
373
+    /**
374
+     * Returns email todo flags' specific MAPI properties.
375
+     *
376
+     * @return array
377
+     */
378
+    public static function GetMailFlagsProperties() {
379
+        return [
380
+            "todoitemsflags" => PR_TODO_ITEM_FLAGS,
381
+            "todotitle" => "PT_STRING8:PSETID_Common:0x85A4",
382
+            "flagicon" => PR_FLAG_ICON,
383
+            "replyrequested" => PR_REPLY_REQUESTED,
384
+            "responserequested" => PR_RESPONSE_REQUESTED,
385
+            "status" => "PT_LONG:PSETID_Task:0x8101",
386
+            "completion" => "PT_DOUBLE:PSETID_Task:0x8102",
387
+            "complete" => "PT_BOOLEAN:PSETID_Task:0x811C",
388
+        ];
389
+    }
390 390
 
391
-	/**
392
-	 * Returns the MAPI to AS mapping for notes.
393
-	 *
394
-	 * @return array
395
-	 */
396
-	public static function GetNoteMapping() {
397
-		return [
398
-			"categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
399
-			"lastmodified" => PR_LAST_MODIFICATION_TIME,
400
-			"messageclass" => PR_MESSAGE_CLASS,
401
-			"subject" => PR_SUBJECT,
402
-			"Color" => "PT_LONG:PSETID_Note:0x8B00",
403
-			"Iconindex" => PR_ICON_INDEX,
404
-		];
405
-	}
391
+    /**
392
+     * Returns the MAPI to AS mapping for notes.
393
+     *
394
+     * @return array
395
+     */
396
+    public static function GetNoteMapping() {
397
+        return [
398
+            "categories" => "PT_MV_STRING8:PS_PUBLIC_STRINGS:Keywords",
399
+            "lastmodified" => PR_LAST_MODIFICATION_TIME,
400
+            "messageclass" => PR_MESSAGE_CLASS,
401
+            "subject" => PR_SUBJECT,
402
+            "Color" => "PT_LONG:PSETID_Note:0x8B00",
403
+            "Iconindex" => PR_ICON_INDEX,
404
+        ];
405
+    }
406 406
 
407
-	/**
408
-	 * Returns note specific MAPI properties.
409
-	 *
410
-	 * @return array
411
-	 */
412
-	public static function GetNoteProperties() {
413
-		return [
414
-			"body" => PR_BODY,
415
-			"messageclass" => PR_MESSAGE_CLASS,
416
-			"html" => PR_HTML,
417
-			"internetcpid" => PR_INTERNET_CPID,
418
-		];
419
-	}
407
+    /**
408
+     * Returns note specific MAPI properties.
409
+     *
410
+     * @return array
411
+     */
412
+    public static function GetNoteProperties() {
413
+        return [
414
+            "body" => PR_BODY,
415
+            "messageclass" => PR_MESSAGE_CLASS,
416
+            "html" => PR_HTML,
417
+            "internetcpid" => PR_INTERNET_CPID,
418
+        ];
419
+    }
420 420
 
421
-	/**
422
-	 * Returns properties for sending an email.
423
-	 *
424
-	 * @return array
425
-	 */
426
-	public static function GetSendMailProperties() {
427
-		return [
428
-			"outboxentryid" => PR_IPM_OUTBOX_ENTRYID,
429
-			"ipmsentmailentryid" => PR_IPM_SENTMAIL_ENTRYID,
430
-			"sentmailentryid" => PR_SENTMAIL_ENTRYID,
431
-			"subject" => PR_SUBJECT,
432
-			"messageclass" => PR_MESSAGE_CLASS,
433
-			"deliverytime" => PR_MESSAGE_DELIVERY_TIME,
434
-			"importance" => PR_IMPORTANCE,
435
-			"priority" => PR_PRIORITY,
436
-			"addrtype" => PR_ADDRTYPE,
437
-			"emailaddress" => PR_EMAIL_ADDRESS,
438
-			"displayname" => PR_DISPLAY_NAME,
439
-			"recipienttype" => PR_RECIPIENT_TYPE,
440
-			"entryid" => PR_ENTRYID,
441
-			"iconindex" => PR_ICON_INDEX,
442
-			"body" => PR_BODY,
443
-			"html" => PR_HTML,
444
-			"sentrepresentingname" => PR_SENT_REPRESENTING_NAME,
445
-			"sentrepresentingemail" => PR_SENT_REPRESENTING_EMAIL_ADDRESS,
446
-			"representingentryid" => PR_SENT_REPRESENTING_ENTRYID,
447
-			"sentrepresentingaddt" => PR_SENT_REPRESENTING_ADDRTYPE,
448
-			"sentrepresentinsrchk" => PR_SENT_REPRESENTING_SEARCH_KEY,
449
-			"displayto" => PR_DISPLAY_TO,
450
-			"displaycc" => PR_DISPLAY_CC,
451
-			"clientsubmittime" => PR_CLIENT_SUBMIT_TIME,
452
-			"attachnum" => PR_ATTACH_NUM,
453
-			"attachdatabin" => PR_ATTACH_DATA_BIN,
454
-			"internetcpid" => PR_INTERNET_CPID,
455
-			"rtf" => PR_RTF_COMPRESSED,
456
-			"rtfinsync" => PR_RTF_IN_SYNC,
457
-		];
458
-	}
421
+    /**
422
+     * Returns properties for sending an email.
423
+     *
424
+     * @return array
425
+     */
426
+    public static function GetSendMailProperties() {
427
+        return [
428
+            "outboxentryid" => PR_IPM_OUTBOX_ENTRYID,
429
+            "ipmsentmailentryid" => PR_IPM_SENTMAIL_ENTRYID,
430
+            "sentmailentryid" => PR_SENTMAIL_ENTRYID,
431
+            "subject" => PR_SUBJECT,
432
+            "messageclass" => PR_MESSAGE_CLASS,
433
+            "deliverytime" => PR_MESSAGE_DELIVERY_TIME,
434
+            "importance" => PR_IMPORTANCE,
435
+            "priority" => PR_PRIORITY,
436
+            "addrtype" => PR_ADDRTYPE,
437
+            "emailaddress" => PR_EMAIL_ADDRESS,
438
+            "displayname" => PR_DISPLAY_NAME,
439
+            "recipienttype" => PR_RECIPIENT_TYPE,
440
+            "entryid" => PR_ENTRYID,
441
+            "iconindex" => PR_ICON_INDEX,
442
+            "body" => PR_BODY,
443
+            "html" => PR_HTML,
444
+            "sentrepresentingname" => PR_SENT_REPRESENTING_NAME,
445
+            "sentrepresentingemail" => PR_SENT_REPRESENTING_EMAIL_ADDRESS,
446
+            "representingentryid" => PR_SENT_REPRESENTING_ENTRYID,
447
+            "sentrepresentingaddt" => PR_SENT_REPRESENTING_ADDRTYPE,
448
+            "sentrepresentinsrchk" => PR_SENT_REPRESENTING_SEARCH_KEY,
449
+            "displayto" => PR_DISPLAY_TO,
450
+            "displaycc" => PR_DISPLAY_CC,
451
+            "clientsubmittime" => PR_CLIENT_SUBMIT_TIME,
452
+            "attachnum" => PR_ATTACH_NUM,
453
+            "attachdatabin" => PR_ATTACH_DATA_BIN,
454
+            "internetcpid" => PR_INTERNET_CPID,
455
+            "rtf" => PR_RTF_COMPRESSED,
456
+            "rtfinsync" => PR_RTF_IN_SYNC,
457
+        ];
458
+    }
459 459
 }
Please login to merge, or discard this patch.
lib/grommunio/listfolders.php 3 patches
Indentation   +173 added lines, -173 removed lines patch added patch discarded remove patch
@@ -14,208 +14,208 @@
 block discarded – undo
14 14
 define('SSLCERT_PASS', null);
15 15
 
16 16
 $supported_classes = [
17
-	"IPF.Note" => "SYNC_FOLDER_TYPE_USER_MAIL",
18
-	"IPF.Task" => "SYNC_FOLDER_TYPE_USER_TASK",
19
-	"IPF.Appointment" => "SYNC_FOLDER_TYPE_USER_APPOINTMENT",
20
-	"IPF.Contact" => "SYNC_FOLDER_TYPE_USER_CONTACT",
21
-	"IPF.StickyNote" => "SYNC_FOLDER_TYPE_USER_NOTE",
17
+    "IPF.Note" => "SYNC_FOLDER_TYPE_USER_MAIL",
18
+    "IPF.Task" => "SYNC_FOLDER_TYPE_USER_TASK",
19
+    "IPF.Appointment" => "SYNC_FOLDER_TYPE_USER_APPOINTMENT",
20
+    "IPF.Contact" => "SYNC_FOLDER_TYPE_USER_CONTACT",
21
+    "IPF.StickyNote" => "SYNC_FOLDER_TYPE_USER_NOTE",
22 22
 ];
23 23
 
24 24
 main();
25 25
 
26 26
 function main() {
27
-	listfolders_configure();
28
-	listfolders_handle();
27
+    listfolders_configure();
28
+    listfolders_handle();
29 29
 }
30 30
 
31 31
 function listfolders_configure() {
32
-	if (php_sapi_name() != "cli") {
33
-		fwrite(STDERR, "This script can only be called from the CLI.\n");
32
+    if (php_sapi_name() != "cli") {
33
+        fwrite(STDERR, "This script can only be called from the CLI.\n");
34 34
 
35
-		exit(1);
36
-	}
35
+        exit(1);
36
+    }
37 37
 
38
-	if (!function_exists("getopt")) {
39
-		echo "PHP Function 'getopt()' not found. Please check your PHP version and settings.\n";
38
+    if (!function_exists("getopt")) {
39
+        echo "PHP Function 'getopt()' not found. Please check your PHP version and settings.\n";
40 40
 
41
-		exit(1);
42
-	}
41
+        exit(1);
42
+    }
43 43
 
44
-	require 'mapi/mapi.util.php';
45
-	require 'mapi/mapidefs.php';
46
-	require 'mapi/mapicode.php';
47
-	require 'mapi/mapitags.php';
48
-	require 'mapi/mapiguid.php';
44
+    require 'mapi/mapi.util.php';
45
+    require 'mapi/mapidefs.php';
46
+    require 'mapi/mapicode.php';
47
+    require 'mapi/mapitags.php';
48
+    require 'mapi/mapiguid.php';
49 49
 }
50 50
 
51 51
 function listfolders_handle() {
52
-	$shortoptions = "l:h:u:p:c:";
53
-	$options = getopt($shortoptions);
54
-
55
-	$mapi = MAPI_SERVER;
56
-	$sslcert_file = SSLCERT_FILE;
57
-	$sslcert_pass = SSLCERT_PASS;
58
-	$user = "SYSTEM";
59
-	$pass = "";
60
-
61
-	if (isset($options['h'])) {
62
-		$mapi = $options['h'];
63
-	}
64
-
65
-	// accept a remote user
66
-	if (isset($options['u'], $options['p'])) {
67
-		$user = $options['u'];
68
-		$pass = $options['p'];
69
-	}
70
-	// accept a certificate and passwort for login
71
-	elseif (isset($options['c'], $options['p'])) {
72
-		$sslcert_file = $options['c'];
73
-		$sslcert_pass = $options['p'];
74
-	}
75
-
76
-	$zarafaAdmin = listfolders_zarafa_admin_setup($mapi, $user, $pass, $sslcert_file, $sslcert_pass);
77
-	if (isset($zarafaAdmin['adminStore'], $options['l'])) {
78
-		listfolders_getlist($zarafaAdmin['adminStore'], $zarafaAdmin['session'], trim($options['l']));
79
-	}
80
-	else {
81
-		echo "Usage:\n" .
82
-				"listfolders.php [actions] [options]\n\n" .
83
-				"Actions: [-l username]\n" .
84
-					"\t-l username\tlist folders of user, for public folder use 'SYSTEM'\n\n" .
85
-				"Global options: [-h path] [[-u remoteuser] [-p password]] [[-c certificate_path] [-p password]]\n" .
86
-					"\t-h path\t\tconnect through <path>, e.g. file:///var/run/socket or https://10.0.0.1:237/grommunio\n" .
87
-					"\t-u remoteuser\tlogin as authenticated administration user\n" .
88
-					"\t-c certificate\tlogin with a ssl certificate located in this location, e.g. /etc/zarafa/ssl/client.pem\n" .
89
-					"\t-p password\tpassword of the remoteuser or certificate\n\n";
90
-	}
52
+    $shortoptions = "l:h:u:p:c:";
53
+    $options = getopt($shortoptions);
54
+
55
+    $mapi = MAPI_SERVER;
56
+    $sslcert_file = SSLCERT_FILE;
57
+    $sslcert_pass = SSLCERT_PASS;
58
+    $user = "SYSTEM";
59
+    $pass = "";
60
+
61
+    if (isset($options['h'])) {
62
+        $mapi = $options['h'];
63
+    }
64
+
65
+    // accept a remote user
66
+    if (isset($options['u'], $options['p'])) {
67
+        $user = $options['u'];
68
+        $pass = $options['p'];
69
+    }
70
+    // accept a certificate and passwort for login
71
+    elseif (isset($options['c'], $options['p'])) {
72
+        $sslcert_file = $options['c'];
73
+        $sslcert_pass = $options['p'];
74
+    }
75
+
76
+    $zarafaAdmin = listfolders_zarafa_admin_setup($mapi, $user, $pass, $sslcert_file, $sslcert_pass);
77
+    if (isset($zarafaAdmin['adminStore'], $options['l'])) {
78
+        listfolders_getlist($zarafaAdmin['adminStore'], $zarafaAdmin['session'], trim($options['l']));
79
+    }
80
+    else {
81
+        echo "Usage:\n" .
82
+                "listfolders.php [actions] [options]\n\n" .
83
+                "Actions: [-l username]\n" .
84
+                    "\t-l username\tlist folders of user, for public folder use 'SYSTEM'\n\n" .
85
+                "Global options: [-h path] [[-u remoteuser] [-p password]] [[-c certificate_path] [-p password]]\n" .
86
+                    "\t-h path\t\tconnect through <path>, e.g. file:///var/run/socket or https://10.0.0.1:237/grommunio\n" .
87
+                    "\t-u remoteuser\tlogin as authenticated administration user\n" .
88
+                    "\t-c certificate\tlogin with a ssl certificate located in this location, e.g. /etc/zarafa/ssl/client.pem\n" .
89
+                    "\t-p password\tpassword of the remoteuser or certificate\n\n";
90
+    }
91 91
 }
92 92
 
93 93
 function listfolders_zarafa_admin_setup($mapi, $user, $pass, $sslcert_file, $sslcert_pass) {
94
-	$session = @mapi_logon_zarafa($user, $pass, $mapi, $sslcert_file, $sslcert_pass, 0, 'script', 'script');
94
+    $session = @mapi_logon_zarafa($user, $pass, $mapi, $sslcert_file, $sslcert_pass, 0, 'script', 'script');
95 95
 
96
-	if (!$session) {
97
-		printf("User '%s' could not login. The script will exit. Errorcode: 0x%08x\n", $user, mapi_last_hresult());
96
+    if (!$session) {
97
+        printf("User '%s' could not login. The script will exit. Errorcode: 0x%08x\n", $user, mapi_last_hresult());
98 98
 
99
-		exit(1);
100
-	}
99
+        exit(1);
100
+    }
101 101
 
102
-	$adminStore = null;
103
-	$stores = @mapi_getmsgstorestable($session);
104
-	$storeslist = @mapi_table_queryallrows($stores, [PR_ENTRYID, PR_DEFAULT_STORE, PR_MDB_PROVIDER]);
105
-	foreach ($storeslist as $store) {
106
-		if (isset($store[PR_DEFAULT_STORE]) && $store[PR_DEFAULT_STORE] == true) {
107
-			$adminStore = @mapi_openmsgstore($session, $store[PR_ENTRYID]);
102
+    $adminStore = null;
103
+    $stores = @mapi_getmsgstorestable($session);
104
+    $storeslist = @mapi_table_queryallrows($stores, [PR_ENTRYID, PR_DEFAULT_STORE, PR_MDB_PROVIDER]);
105
+    foreach ($storeslist as $store) {
106
+        if (isset($store[PR_DEFAULT_STORE]) && $store[PR_DEFAULT_STORE] == true) {
107
+            $adminStore = @mapi_openmsgstore($session, $store[PR_ENTRYID]);
108 108
 
109
-			break;
110
-		}
111
-	}
112
-	$zarafauserinfo['admin'] = 1;
113
-	$admin = (isset($zarafauserinfo['admin']) && $zarafauserinfo['admin']) ? true : false;
109
+            break;
110
+        }
111
+    }
112
+    $zarafauserinfo['admin'] = 1;
113
+    $admin = (isset($zarafauserinfo['admin']) && $zarafauserinfo['admin']) ? true : false;
114 114
 
115
-	if (!$stores || !$storeslist || !$adminStore || !$admin) {
116
-		echo "There was error trying to log in as admin or retrieving admin info. The script will exit.\n";
115
+    if (!$stores || !$storeslist || !$adminStore || !$admin) {
116
+        echo "There was error trying to log in as admin or retrieving admin info. The script will exit.\n";
117 117
 
118
-		exit(1);
119
-	}
118
+        exit(1);
119
+    }
120 120
 
121
-	return ["session" => $session, "adminStore" => $adminStore];
121
+    return ["session" => $session, "adminStore" => $adminStore];
122 122
 }
123 123
 
124 124
 function listfolders_getlist($adminStore, $session, $user) {
125
-	global $supported_classes;
126
-
127
-	if (strtoupper($user) == 'SYSTEM') {
128
-		// Find the public store store
129
-		$storestables = @mapi_getmsgstorestable($session);
130
-		$result = @mapi_last_hresult();
131
-
132
-		if ($result == NOERROR) {
133
-			$rows = @mapi_table_queryallrows($storestables, [PR_ENTRYID, PR_MDB_PROVIDER]);
134
-
135
-			foreach ($rows as $row) {
136
-				if (isset($row[PR_MDB_PROVIDER]) && $row[PR_MDB_PROVIDER] == ZARAFA_STORE_PUBLIC_GUID) {
137
-					if (!isset($row[PR_ENTRYID])) {
138
-						echo "Public folder are not available.\nIf this is a multi-tenancy system, use -u and -p and login with an admin user of the company.\nThe script will exit.\n";
139
-
140
-						exit(1);
141
-					}
142
-					$entryid = $row[PR_ENTRYID];
143
-
144
-					break;
145
-				}
146
-			}
147
-		}
148
-	}
149
-	else {
150
-		$entryid = @mapi_msgstore_createentryid($adminStore, $user);
151
-	}
152
-
153
-	$userStore = @mapi_openmsgstore($session, $entryid);
154
-	$hresult = mapi_last_hresult();
155
-
156
-	// Cache the store for later use
157
-	if ($hresult != NOERROR) {
158
-		echo "Could not open store for '{$user}'. The script will exit.\n";
159
-
160
-		exit(1);
161
-	}
162
-
163
-	if (strtoupper($user) != 'SYSTEM') {
164
-		$inbox = mapi_msgstore_getreceivefolder($userStore);
165
-		if (mapi_last_hresult() != NOERROR) {
166
-			printf("Could not open inbox for %s (0x%08X). The script will exit.\n", $user, mapi_last_hresult());
167
-
168
-			exit(1);
169
-		}
170
-		$inboxProps = mapi_getprops($inbox, [PR_SOURCE_KEY]);
171
-	}
172
-
173
-	$storeProps = mapi_getprops($userStore, [PR_IPM_OUTBOX_ENTRYID, PR_IPM_SENTMAIL_ENTRYID, PR_IPM_WASTEBASKET_ENTRYID]);
174
-	$root = @mapi_msgstore_openentry($userStore, null);
175
-	$h_table = @mapi_folder_gethierarchytable($root, CONVENIENT_DEPTH);
176
-	$subfolders = @mapi_table_queryallrows($h_table, [PR_ENTRYID, PR_DISPLAY_NAME, PR_CONTAINER_CLASS, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, PR_FOLDER_TYPE, PR_ATTR_HIDDEN]);
177
-
178
-	echo "Available folders in store '{$user}':\n" . str_repeat("-", 50) . "\n";
179
-	foreach ($subfolders as $folder) {
180
-		// do not display hidden and search folders
181
-		if ((isset($folder[PR_ATTR_HIDDEN]) && $folder[PR_ATTR_HIDDEN]) ||
182
-			(isset($folder[PR_FOLDER_TYPE]) && $folder[PR_FOLDER_TYPE] == FOLDER_SEARCH)) {
183
-			continue;
184
-		}
185
-
186
-		// handle some special folders
187
-		if ((strtoupper($user) != 'SYSTEM') &&
188
-			((isset($inboxProps[PR_SOURCE_KEY]) && $folder[PR_SOURCE_KEY] == $inboxProps[PR_SOURCE_KEY]) ||
189
-			$folder[PR_ENTRYID] == $storeProps[PR_IPM_SENTMAIL_ENTRYID] ||
190
-			$folder[PR_ENTRYID] == $storeProps[PR_IPM_WASTEBASKET_ENTRYID])) {
191
-			$folder[PR_CONTAINER_CLASS] = "IPF.Note";
192
-		}
193
-
194
-		if (isset($folder[PR_CONTAINER_CLASS]) && array_key_exists($folder[PR_CONTAINER_CLASS], $supported_classes)) {
195
-			echo "Folder name:\t" . $folder[PR_DISPLAY_NAME] . "\n";
196
-			echo "Folder ID:\t" . bin2hex($folder[PR_SOURCE_KEY]) . "\n";
197
-			echo "Type:\t\t" . $supported_classes[$folder[PR_CONTAINER_CLASS]] . "\n";
198
-			echo "\n";
199
-		}
200
-	}
125
+    global $supported_classes;
126
+
127
+    if (strtoupper($user) == 'SYSTEM') {
128
+        // Find the public store store
129
+        $storestables = @mapi_getmsgstorestable($session);
130
+        $result = @mapi_last_hresult();
131
+
132
+        if ($result == NOERROR) {
133
+            $rows = @mapi_table_queryallrows($storestables, [PR_ENTRYID, PR_MDB_PROVIDER]);
134
+
135
+            foreach ($rows as $row) {
136
+                if (isset($row[PR_MDB_PROVIDER]) && $row[PR_MDB_PROVIDER] == ZARAFA_STORE_PUBLIC_GUID) {
137
+                    if (!isset($row[PR_ENTRYID])) {
138
+                        echo "Public folder are not available.\nIf this is a multi-tenancy system, use -u and -p and login with an admin user of the company.\nThe script will exit.\n";
139
+
140
+                        exit(1);
141
+                    }
142
+                    $entryid = $row[PR_ENTRYID];
143
+
144
+                    break;
145
+                }
146
+            }
147
+        }
148
+    }
149
+    else {
150
+        $entryid = @mapi_msgstore_createentryid($adminStore, $user);
151
+    }
152
+
153
+    $userStore = @mapi_openmsgstore($session, $entryid);
154
+    $hresult = mapi_last_hresult();
155
+
156
+    // Cache the store for later use
157
+    if ($hresult != NOERROR) {
158
+        echo "Could not open store for '{$user}'. The script will exit.\n";
159
+
160
+        exit(1);
161
+    }
162
+
163
+    if (strtoupper($user) != 'SYSTEM') {
164
+        $inbox = mapi_msgstore_getreceivefolder($userStore);
165
+        if (mapi_last_hresult() != NOERROR) {
166
+            printf("Could not open inbox for %s (0x%08X). The script will exit.\n", $user, mapi_last_hresult());
167
+
168
+            exit(1);
169
+        }
170
+        $inboxProps = mapi_getprops($inbox, [PR_SOURCE_KEY]);
171
+    }
172
+
173
+    $storeProps = mapi_getprops($userStore, [PR_IPM_OUTBOX_ENTRYID, PR_IPM_SENTMAIL_ENTRYID, PR_IPM_WASTEBASKET_ENTRYID]);
174
+    $root = @mapi_msgstore_openentry($userStore, null);
175
+    $h_table = @mapi_folder_gethierarchytable($root, CONVENIENT_DEPTH);
176
+    $subfolders = @mapi_table_queryallrows($h_table, [PR_ENTRYID, PR_DISPLAY_NAME, PR_CONTAINER_CLASS, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, PR_FOLDER_TYPE, PR_ATTR_HIDDEN]);
177
+
178
+    echo "Available folders in store '{$user}':\n" . str_repeat("-", 50) . "\n";
179
+    foreach ($subfolders as $folder) {
180
+        // do not display hidden and search folders
181
+        if ((isset($folder[PR_ATTR_HIDDEN]) && $folder[PR_ATTR_HIDDEN]) ||
182
+            (isset($folder[PR_FOLDER_TYPE]) && $folder[PR_FOLDER_TYPE] == FOLDER_SEARCH)) {
183
+            continue;
184
+        }
185
+
186
+        // handle some special folders
187
+        if ((strtoupper($user) != 'SYSTEM') &&
188
+            ((isset($inboxProps[PR_SOURCE_KEY]) && $folder[PR_SOURCE_KEY] == $inboxProps[PR_SOURCE_KEY]) ||
189
+            $folder[PR_ENTRYID] == $storeProps[PR_IPM_SENTMAIL_ENTRYID] ||
190
+            $folder[PR_ENTRYID] == $storeProps[PR_IPM_WASTEBASKET_ENTRYID])) {
191
+            $folder[PR_CONTAINER_CLASS] = "IPF.Note";
192
+        }
193
+
194
+        if (isset($folder[PR_CONTAINER_CLASS]) && array_key_exists($folder[PR_CONTAINER_CLASS], $supported_classes)) {
195
+            echo "Folder name:\t" . $folder[PR_DISPLAY_NAME] . "\n";
196
+            echo "Folder ID:\t" . bin2hex($folder[PR_SOURCE_KEY]) . "\n";
197
+            echo "Type:\t\t" . $supported_classes[$folder[PR_CONTAINER_CLASS]] . "\n";
198
+            echo "\n";
199
+        }
200
+    }
201 201
 }
202 202
 
203 203
 function CheckMapiExtVersion($version = "") {
204
-	// compare build number if requested
205
-	if (preg_match('/^\d+$/', $version) && strlen($version) > 3) {
206
-		$vs = preg_split('/-/', phpversion("mapi"));
207
-
208
-		return $version <= $vs[1];
209
-	}
210
-
211
-	if (extension_loaded("mapi")) {
212
-		if (version_compare(phpversion("mapi"), $version) == -1) {
213
-			return false;
214
-		}
215
-	}
216
-	else {
217
-		return false;
218
-	}
219
-
220
-	return true;
204
+    // compare build number if requested
205
+    if (preg_match('/^\d+$/', $version) && strlen($version) > 3) {
206
+        $vs = preg_split('/-/', phpversion("mapi"));
207
+
208
+        return $version <= $vs[1];
209
+    }
210
+
211
+    if (extension_loaded("mapi")) {
212
+        if (version_compare(phpversion("mapi"), $version) == -1) {
213
+            return false;
214
+        }
215
+    }
216
+    else {
217
+        return false;
218
+    }
219
+
220
+    return true;
221 221
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 		listfolders_getlist($zarafaAdmin['adminStore'], $zarafaAdmin['session'], trim($options['l']));
79 79
 	}
80 80
 	else {
81
-		echo "Usage:\n" .
82
-				"listfolders.php [actions] [options]\n\n" .
83
-				"Actions: [-l username]\n" .
84
-					"\t-l username\tlist folders of user, for public folder use 'SYSTEM'\n\n" .
85
-				"Global options: [-h path] [[-u remoteuser] [-p password]] [[-c certificate_path] [-p password]]\n" .
86
-					"\t-h path\t\tconnect through <path>, e.g. file:///var/run/socket or https://10.0.0.1:237/grommunio\n" .
87
-					"\t-u remoteuser\tlogin as authenticated administration user\n" .
88
-					"\t-c certificate\tlogin with a ssl certificate located in this location, e.g. /etc/zarafa/ssl/client.pem\n" .
81
+		echo "Usage:\n".
82
+				"listfolders.php [actions] [options]\n\n".
83
+				"Actions: [-l username]\n".
84
+					"\t-l username\tlist folders of user, for public folder use 'SYSTEM'\n\n".
85
+				"Global options: [-h path] [[-u remoteuser] [-p password]] [[-c certificate_path] [-p password]]\n".
86
+					"\t-h path\t\tconnect through <path>, e.g. file:///var/run/socket or https://10.0.0.1:237/grommunio\n".
87
+					"\t-u remoteuser\tlogin as authenticated administration user\n".
88
+					"\t-c certificate\tlogin with a ssl certificate located in this location, e.g. /etc/zarafa/ssl/client.pem\n".
89 89
 					"\t-p password\tpassword of the remoteuser or certificate\n\n";
90 90
 	}
91 91
 }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	$h_table = @mapi_folder_gethierarchytable($root, CONVENIENT_DEPTH);
176 176
 	$subfolders = @mapi_table_queryallrows($h_table, [PR_ENTRYID, PR_DISPLAY_NAME, PR_CONTAINER_CLASS, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, PR_FOLDER_TYPE, PR_ATTR_HIDDEN]);
177 177
 
178
-	echo "Available folders in store '{$user}':\n" . str_repeat("-", 50) . "\n";
178
+	echo "Available folders in store '{$user}':\n".str_repeat("-", 50)."\n";
179 179
 	foreach ($subfolders as $folder) {
180 180
 		// do not display hidden and search folders
181 181
 		if ((isset($folder[PR_ATTR_HIDDEN]) && $folder[PR_ATTR_HIDDEN]) ||
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
 		}
193 193
 
194 194
 		if (isset($folder[PR_CONTAINER_CLASS]) && array_key_exists($folder[PR_CONTAINER_CLASS], $supported_classes)) {
195
-			echo "Folder name:\t" . $folder[PR_DISPLAY_NAME] . "\n";
196
-			echo "Folder ID:\t" . bin2hex($folder[PR_SOURCE_KEY]) . "\n";
197
-			echo "Type:\t\t" . $supported_classes[$folder[PR_CONTAINER_CLASS]] . "\n";
195
+			echo "Folder name:\t".$folder[PR_DISPLAY_NAME]."\n";
196
+			echo "Folder ID:\t".bin2hex($folder[PR_SOURCE_KEY])."\n";
197
+			echo "Type:\t\t".$supported_classes[$folder[PR_CONTAINER_CLASS]]."\n";
198 198
 			echo "\n";
199 199
 		}
200 200
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,8 +76,7 @@  discard block
 block discarded – undo
76 76
 	$zarafaAdmin = listfolders_zarafa_admin_setup($mapi, $user, $pass, $sslcert_file, $sslcert_pass);
77 77
 	if (isset($zarafaAdmin['adminStore'], $options['l'])) {
78 78
 		listfolders_getlist($zarafaAdmin['adminStore'], $zarafaAdmin['session'], trim($options['l']));
79
-	}
80
-	else {
79
+	} else {
81 80
 		echo "Usage:\n" .
82 81
 				"listfolders.php [actions] [options]\n\n" .
83 82
 				"Actions: [-l username]\n" .
@@ -145,8 +144,7 @@  discard block
 block discarded – undo
145 144
 				}
146 145
 			}
147 146
 		}
148
-	}
149
-	else {
147
+	} else {
150 148
 		$entryid = @mapi_msgstore_createentryid($adminStore, $user);
151 149
 	}
152 150
 
@@ -212,8 +210,7 @@  discard block
 block discarded – undo
212 210
 		if (version_compare(phpversion("mapi"), $version) == -1) {
213 211
 			return false;
214 212
 		}
215
-	}
216
-	else {
213
+	} else {
217 214
 		return false;
218 215
 	}
219 216
 
Please login to merge, or discard this patch.
lib/grommunio/mapiphpwrapper.php 3 patches
Indentation   +216 added lines, -216 removed lines patch added patch discarded remove patch
@@ -17,220 +17,220 @@
 block discarded – undo
17 17
  * convert the data into WBXML which is streamed to the PDA.
18 18
  */
19 19
 class PHPWrapper {
20
-	private $importer;
21
-	private $mapiprovider;
22
-	private $store;
23
-	private $contentparameters;
24
-	private $folderid;
25
-	private $prefix;
26
-
27
-	/**
28
-	 * Constructor of the PHPWrapper.
29
-	 *
30
-	 * @param resource       $session
31
-	 * @param resource       $store
32
-	 * @param IImportChanges $importer incoming changes from ICS are forwarded here
33
-	 * @param string         $folderid the folder this wrapper was configured for
34
-	 *
35
-	 * @return
36
-	 */
37
-	public function __construct($session, $store, $importer, $folderid) {
38
-		$this->importer = &$importer;
39
-		$this->store = $store;
40
-		$this->mapiprovider = new MAPIProvider($session, $this->store);
41
-		$this->folderid = $folderid;
42
-		$this->prefix = '';
43
-
44
-		if ($folderid) {
45
-			$folderidHex = bin2hex($folderid);
46
-			$folderid = GSync::GetDeviceManager()->GetFolderIdForBackendId($folderidHex);
47
-			if ($folderid != $folderidHex) {
48
-				$this->prefix = $folderid . ':';
49
-			}
50
-		}
51
-	}
52
-
53
-	/**
54
-	 * Configures additional parameters used for content synchronization.
55
-	 *
56
-	 * @param ContentParameters $contentparameters
57
-	 *
58
-	 * @throws StatusException
59
-	 *
60
-	 * @return bool
61
-	 */
62
-	public function ConfigContentParameters($contentparameters) {
63
-		$this->contentparameters = $contentparameters;
64
-
65
-		return true;
66
-	}
67
-
68
-	/**
69
-	 * Implement MAPI interface.
70
-	 *
71
-	 * @param mixed $stream
72
-	 * @param mixed $flags
73
-	 */
74
-	public function Config($stream, $flags = 0) {
75
-	}
76
-
77
-	public function GetLastError($hresult, $ulflags, &$lpmapierror) {
78
-	}
79
-
80
-	public function UpdateState($stream) {
81
-	}
82
-
83
-	/**
84
-	 * Imports a single message.
85
-	 *
86
-	 * @param array  $props
87
-	 * @param long   $flags
88
-	 * @param object $retmapimessage
89
-	 *
90
-	 * @return long
91
-	 */
92
-	public function ImportMessageChange($props, $flags, $retmapimessage) {
93
-		$sourcekey = $props[PR_SOURCE_KEY];
94
-		$parentsourcekey = $props[PR_PARENT_SOURCE_KEY];
95
-		$entryid = mapi_msgstore_entryidfromsourcekey($this->store, $parentsourcekey, $sourcekey);
96
-
97
-		if (!$entryid) {
98
-			return SYNC_E_IGNORE;
99
-		}
100
-
101
-		$mapimessage = mapi_msgstore_openentry($this->store, $entryid);
102
-
103
-		try {
104
-			SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageChange(): Getting message from MAPIProvider, sourcekey: '%s', parentsourcekey: '%s', entryid: '%s'", bin2hex($sourcekey), bin2hex($parentsourcekey), bin2hex($entryid)));
105
-
106
-			$message = $this->mapiprovider->GetMessage($mapimessage, $this->contentparameters);
107
-
108
-			// strip or do not send private messages from shared folders to the device
109
-			if (MAPIUtils::IsMessageSharedAndPrivate($this->folderid, $mapimessage)) {
110
-				if ($message->SupportsPrivateStripping()) {
111
-					SLog::Write(LOGLEVEL_DEBUG, "PHPWrapper->ImportMessageChange(): stripping data of private message from a shared folder");
112
-					$message->StripData(Streamer::STRIP_PRIVATE_DATA);
113
-				}
114
-				else {
115
-					SLog::Write(LOGLEVEL_DEBUG, "PHPWrapper->ImportMessageChange(): ignoring private message from a shared folder");
116
-
117
-					return SYNC_E_IGNORE;
118
-				}
119
-			}
120
-		}
121
-		catch (SyncObjectBrokenException $mbe) {
122
-			$brokenSO = $mbe->GetSyncObject();
123
-			if (!$brokenSO) {
124
-				SLog::Write(LOGLEVEL_ERROR, sprintf("PHPWrapper->ImportMessageChange(): Caught SyncObjectBrokenException but broken SyncObject available"));
125
-			}
126
-			else {
127
-				if (!isset($brokenSO->id)) {
128
-					$brokenSO->id = "Unknown ID";
129
-					SLog::Write(LOGLEVEL_ERROR, sprintf("PHPWrapper->ImportMessageChange(): Caught SyncObjectBrokenException but no ID of object set"));
130
-				}
131
-				GSync::GetDeviceManager()->AnnounceIgnoredMessage(false, $brokenSO->id, $brokenSO);
132
-			}
133
-			// tell MAPI to ignore the message
134
-			return SYNC_E_IGNORE;
135
-		}
136
-
137
-		// substitute the MAPI SYNC_NEW_MESSAGE flag by a grommunio-sync proprietary flag
138
-		if ($flags == SYNC_NEW_MESSAGE) {
139
-			$message->flags = SYNC_NEWMESSAGE;
140
-		}
141
-		else {
142
-			$message->flags = $flags;
143
-		}
144
-
145
-		$this->importer->ImportMessageChange($this->prefix . bin2hex($sourcekey), $message);
146
-		SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageChange(): change for: '%s'", $this->prefix . bin2hex($sourcekey)));
147
-
148
-		// Tell MAPI it doesn't need to do anything itself, as we've done all the work already.
149
-		return SYNC_E_IGNORE;
150
-	}
151
-
152
-	/**
153
-	 * Imports a list of messages to be deleted.
154
-	 *
155
-	 * @param long  $flags
156
-	 * @param array $sourcekeys array with sourcekeys
157
-	 *
158
-	 * @return
159
-	 */
160
-	public function ImportMessageDeletion($flags, $sourcekeys) {
161
-		$amount = count($sourcekeys);
162
-		SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageDeletion(): Received %d remove requests from ICS", $amount));
163
-
164
-		foreach ($sourcekeys as $sourcekey) {
165
-			// TODO if we would know that ICS is removing the message because it's outside the sync interval, we could send a $asSoftDelete = true to the importer. Could they pass that via $flags?
166
-			$this->importer->ImportMessageDeletion($this->prefix . bin2hex($sourcekey));
167
-			SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageDeletion(): delete for :'%s'", $this->prefix . bin2hex($sourcekey)));
168
-		}
169
-	}
170
-
171
-	/**
172
-	 * Imports a list of messages to be deleted.
173
-	 *
174
-	 * @param mixed $readstates sourcekeys and message flags
175
-	 *
176
-	 * @return
177
-	 */
178
-	public function ImportPerUserReadStateChange($readstates) {
179
-		foreach ($readstates as $readstate) {
180
-			$this->importer->ImportMessageReadFlag($this->prefix . bin2hex($readstate["sourcekey"]), $readstate["flags"] & MSGFLAG_READ);
181
-			SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportPerUserReadStateChange(): read for :'%s'", $this->prefix . bin2hex($readstate["sourcekey"])));
182
-		}
183
-	}
184
-
185
-	/**
186
-	 * Imports a message move
187
-	 * this is never called by ICS.
188
-	 *
189
-	 * @param mixed $sourcekeysrcfolder
190
-	 * @param mixed $sourcekeysrcmessage
191
-	 * @param mixed $message
192
-	 * @param mixed $sourcekeydestmessage
193
-	 * @param mixed $changenumdestmessage
194
-	 *
195
-	 * @return
196
-	 */
197
-	public function ImportMessageMove($sourcekeysrcfolder, $sourcekeysrcmessage, $message, $sourcekeydestmessage, $changenumdestmessage) {
198
-		// Never called
199
-	}
200
-
201
-	/**
202
-	 * Imports a single folder change.
203
-	 *
204
-	 * @param array $props properties of the changed folder
205
-	 *
206
-	 * @return
207
-	 */
208
-	public function ImportFolderChange($props) {
209
-		$folder = $this->mapiprovider->GetFolder($props);
210
-
211
-		// do not import folder if there is something "wrong" with it
212
-		if ($folder === false) {
213
-			return 0;
214
-		}
215
-
216
-		$this->importer->ImportFolderChange($folder);
217
-
218
-		return 0;
219
-	}
220
-
221
-	/**
222
-	 * Imports a list of folders which are to be deleted.
223
-	 *
224
-	 * @param long  $flags
225
-	 * @param mixed $sourcekeys array with sourcekeys
226
-	 *
227
-	 * @return
228
-	 */
229
-	public function ImportFolderDeletion($flags, $sourcekeys) {
230
-		foreach ($sourcekeys as $sourcekey) {
231
-			$this->importer->ImportFolderDeletion(SyncFolder::GetObject(GSync::GetDeviceManager()->GetFolderIdForBackendId(bin2hex($sourcekey))));
232
-		}
233
-
234
-		return 0;
235
-	}
20
+    private $importer;
21
+    private $mapiprovider;
22
+    private $store;
23
+    private $contentparameters;
24
+    private $folderid;
25
+    private $prefix;
26
+
27
+    /**
28
+     * Constructor of the PHPWrapper.
29
+     *
30
+     * @param resource       $session
31
+     * @param resource       $store
32
+     * @param IImportChanges $importer incoming changes from ICS are forwarded here
33
+     * @param string         $folderid the folder this wrapper was configured for
34
+     *
35
+     * @return
36
+     */
37
+    public function __construct($session, $store, $importer, $folderid) {
38
+        $this->importer = &$importer;
39
+        $this->store = $store;
40
+        $this->mapiprovider = new MAPIProvider($session, $this->store);
41
+        $this->folderid = $folderid;
42
+        $this->prefix = '';
43
+
44
+        if ($folderid) {
45
+            $folderidHex = bin2hex($folderid);
46
+            $folderid = GSync::GetDeviceManager()->GetFolderIdForBackendId($folderidHex);
47
+            if ($folderid != $folderidHex) {
48
+                $this->prefix = $folderid . ':';
49
+            }
50
+        }
51
+    }
52
+
53
+    /**
54
+     * Configures additional parameters used for content synchronization.
55
+     *
56
+     * @param ContentParameters $contentparameters
57
+     *
58
+     * @throws StatusException
59
+     *
60
+     * @return bool
61
+     */
62
+    public function ConfigContentParameters($contentparameters) {
63
+        $this->contentparameters = $contentparameters;
64
+
65
+        return true;
66
+    }
67
+
68
+    /**
69
+     * Implement MAPI interface.
70
+     *
71
+     * @param mixed $stream
72
+     * @param mixed $flags
73
+     */
74
+    public function Config($stream, $flags = 0) {
75
+    }
76
+
77
+    public function GetLastError($hresult, $ulflags, &$lpmapierror) {
78
+    }
79
+
80
+    public function UpdateState($stream) {
81
+    }
82
+
83
+    /**
84
+     * Imports a single message.
85
+     *
86
+     * @param array  $props
87
+     * @param long   $flags
88
+     * @param object $retmapimessage
89
+     *
90
+     * @return long
91
+     */
92
+    public function ImportMessageChange($props, $flags, $retmapimessage) {
93
+        $sourcekey = $props[PR_SOURCE_KEY];
94
+        $parentsourcekey = $props[PR_PARENT_SOURCE_KEY];
95
+        $entryid = mapi_msgstore_entryidfromsourcekey($this->store, $parentsourcekey, $sourcekey);
96
+
97
+        if (!$entryid) {
98
+            return SYNC_E_IGNORE;
99
+        }
100
+
101
+        $mapimessage = mapi_msgstore_openentry($this->store, $entryid);
102
+
103
+        try {
104
+            SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageChange(): Getting message from MAPIProvider, sourcekey: '%s', parentsourcekey: '%s', entryid: '%s'", bin2hex($sourcekey), bin2hex($parentsourcekey), bin2hex($entryid)));
105
+
106
+            $message = $this->mapiprovider->GetMessage($mapimessage, $this->contentparameters);
107
+
108
+            // strip or do not send private messages from shared folders to the device
109
+            if (MAPIUtils::IsMessageSharedAndPrivate($this->folderid, $mapimessage)) {
110
+                if ($message->SupportsPrivateStripping()) {
111
+                    SLog::Write(LOGLEVEL_DEBUG, "PHPWrapper->ImportMessageChange(): stripping data of private message from a shared folder");
112
+                    $message->StripData(Streamer::STRIP_PRIVATE_DATA);
113
+                }
114
+                else {
115
+                    SLog::Write(LOGLEVEL_DEBUG, "PHPWrapper->ImportMessageChange(): ignoring private message from a shared folder");
116
+
117
+                    return SYNC_E_IGNORE;
118
+                }
119
+            }
120
+        }
121
+        catch (SyncObjectBrokenException $mbe) {
122
+            $brokenSO = $mbe->GetSyncObject();
123
+            if (!$brokenSO) {
124
+                SLog::Write(LOGLEVEL_ERROR, sprintf("PHPWrapper->ImportMessageChange(): Caught SyncObjectBrokenException but broken SyncObject available"));
125
+            }
126
+            else {
127
+                if (!isset($brokenSO->id)) {
128
+                    $brokenSO->id = "Unknown ID";
129
+                    SLog::Write(LOGLEVEL_ERROR, sprintf("PHPWrapper->ImportMessageChange(): Caught SyncObjectBrokenException but no ID of object set"));
130
+                }
131
+                GSync::GetDeviceManager()->AnnounceIgnoredMessage(false, $brokenSO->id, $brokenSO);
132
+            }
133
+            // tell MAPI to ignore the message
134
+            return SYNC_E_IGNORE;
135
+        }
136
+
137
+        // substitute the MAPI SYNC_NEW_MESSAGE flag by a grommunio-sync proprietary flag
138
+        if ($flags == SYNC_NEW_MESSAGE) {
139
+            $message->flags = SYNC_NEWMESSAGE;
140
+        }
141
+        else {
142
+            $message->flags = $flags;
143
+        }
144
+
145
+        $this->importer->ImportMessageChange($this->prefix . bin2hex($sourcekey), $message);
146
+        SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageChange(): change for: '%s'", $this->prefix . bin2hex($sourcekey)));
147
+
148
+        // Tell MAPI it doesn't need to do anything itself, as we've done all the work already.
149
+        return SYNC_E_IGNORE;
150
+    }
151
+
152
+    /**
153
+     * Imports a list of messages to be deleted.
154
+     *
155
+     * @param long  $flags
156
+     * @param array $sourcekeys array with sourcekeys
157
+     *
158
+     * @return
159
+     */
160
+    public function ImportMessageDeletion($flags, $sourcekeys) {
161
+        $amount = count($sourcekeys);
162
+        SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageDeletion(): Received %d remove requests from ICS", $amount));
163
+
164
+        foreach ($sourcekeys as $sourcekey) {
165
+            // TODO if we would know that ICS is removing the message because it's outside the sync interval, we could send a $asSoftDelete = true to the importer. Could they pass that via $flags?
166
+            $this->importer->ImportMessageDeletion($this->prefix . bin2hex($sourcekey));
167
+            SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageDeletion(): delete for :'%s'", $this->prefix . bin2hex($sourcekey)));
168
+        }
169
+    }
170
+
171
+    /**
172
+     * Imports a list of messages to be deleted.
173
+     *
174
+     * @param mixed $readstates sourcekeys and message flags
175
+     *
176
+     * @return
177
+     */
178
+    public function ImportPerUserReadStateChange($readstates) {
179
+        foreach ($readstates as $readstate) {
180
+            $this->importer->ImportMessageReadFlag($this->prefix . bin2hex($readstate["sourcekey"]), $readstate["flags"] & MSGFLAG_READ);
181
+            SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportPerUserReadStateChange(): read for :'%s'", $this->prefix . bin2hex($readstate["sourcekey"])));
182
+        }
183
+    }
184
+
185
+    /**
186
+     * Imports a message move
187
+     * this is never called by ICS.
188
+     *
189
+     * @param mixed $sourcekeysrcfolder
190
+     * @param mixed $sourcekeysrcmessage
191
+     * @param mixed $message
192
+     * @param mixed $sourcekeydestmessage
193
+     * @param mixed $changenumdestmessage
194
+     *
195
+     * @return
196
+     */
197
+    public function ImportMessageMove($sourcekeysrcfolder, $sourcekeysrcmessage, $message, $sourcekeydestmessage, $changenumdestmessage) {
198
+        // Never called
199
+    }
200
+
201
+    /**
202
+     * Imports a single folder change.
203
+     *
204
+     * @param array $props properties of the changed folder
205
+     *
206
+     * @return
207
+     */
208
+    public function ImportFolderChange($props) {
209
+        $folder = $this->mapiprovider->GetFolder($props);
210
+
211
+        // do not import folder if there is something "wrong" with it
212
+        if ($folder === false) {
213
+            return 0;
214
+        }
215
+
216
+        $this->importer->ImportFolderChange($folder);
217
+
218
+        return 0;
219
+    }
220
+
221
+    /**
222
+     * Imports a list of folders which are to be deleted.
223
+     *
224
+     * @param long  $flags
225
+     * @param mixed $sourcekeys array with sourcekeys
226
+     *
227
+     * @return
228
+     */
229
+    public function ImportFolderDeletion($flags, $sourcekeys) {
230
+        foreach ($sourcekeys as $sourcekey) {
231
+            $this->importer->ImportFolderDeletion(SyncFolder::GetObject(GSync::GetDeviceManager()->GetFolderIdForBackendId(bin2hex($sourcekey))));
232
+        }
233
+
234
+        return 0;
235
+    }
236 236
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 			$folderidHex = bin2hex($folderid);
46 46
 			$folderid = GSync::GetDeviceManager()->GetFolderIdForBackendId($folderidHex);
47 47
 			if ($folderid != $folderidHex) {
48
-				$this->prefix = $folderid . ':';
48
+				$this->prefix = $folderid.':';
49 49
 			}
50 50
 		}
51 51
 	}
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 			$message->flags = $flags;
143 143
 		}
144 144
 
145
-		$this->importer->ImportMessageChange($this->prefix . bin2hex($sourcekey), $message);
146
-		SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageChange(): change for: '%s'", $this->prefix . bin2hex($sourcekey)));
145
+		$this->importer->ImportMessageChange($this->prefix.bin2hex($sourcekey), $message);
146
+		SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageChange(): change for: '%s'", $this->prefix.bin2hex($sourcekey)));
147 147
 
148 148
 		// Tell MAPI it doesn't need to do anything itself, as we've done all the work already.
149 149
 		return SYNC_E_IGNORE;
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
 
164 164
 		foreach ($sourcekeys as $sourcekey) {
165 165
 			// TODO if we would know that ICS is removing the message because it's outside the sync interval, we could send a $asSoftDelete = true to the importer. Could they pass that via $flags?
166
-			$this->importer->ImportMessageDeletion($this->prefix . bin2hex($sourcekey));
167
-			SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageDeletion(): delete for :'%s'", $this->prefix . bin2hex($sourcekey)));
166
+			$this->importer->ImportMessageDeletion($this->prefix.bin2hex($sourcekey));
167
+			SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportMessageDeletion(): delete for :'%s'", $this->prefix.bin2hex($sourcekey)));
168 168
 		}
169 169
 	}
170 170
 
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function ImportPerUserReadStateChange($readstates) {
179 179
 		foreach ($readstates as $readstate) {
180
-			$this->importer->ImportMessageReadFlag($this->prefix . bin2hex($readstate["sourcekey"]), $readstate["flags"] & MSGFLAG_READ);
181
-			SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportPerUserReadStateChange(): read for :'%s'", $this->prefix . bin2hex($readstate["sourcekey"])));
180
+			$this->importer->ImportMessageReadFlag($this->prefix.bin2hex($readstate["sourcekey"]), $readstate["flags"] & MSGFLAG_READ);
181
+			SLog::Write(LOGLEVEL_DEBUG, sprintf("PHPWrapper->ImportPerUserReadStateChange(): read for :'%s'", $this->prefix.bin2hex($readstate["sourcekey"])));
182 182
 		}
183 183
 	}
184 184
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -110,20 +110,17 @@  discard block
 block discarded – undo
110 110
 				if ($message->SupportsPrivateStripping()) {
111 111
 					SLog::Write(LOGLEVEL_DEBUG, "PHPWrapper->ImportMessageChange(): stripping data of private message from a shared folder");
112 112
 					$message->StripData(Streamer::STRIP_PRIVATE_DATA);
113
-				}
114
-				else {
113
+				} else {
115 114
 					SLog::Write(LOGLEVEL_DEBUG, "PHPWrapper->ImportMessageChange(): ignoring private message from a shared folder");
116 115
 
117 116
 					return SYNC_E_IGNORE;
118 117
 				}
119 118
 			}
120
-		}
121
-		catch (SyncObjectBrokenException $mbe) {
119
+		} catch (SyncObjectBrokenException $mbe) {
122 120
 			$brokenSO = $mbe->GetSyncObject();
123 121
 			if (!$brokenSO) {
124 122
 				SLog::Write(LOGLEVEL_ERROR, sprintf("PHPWrapper->ImportMessageChange(): Caught SyncObjectBrokenException but broken SyncObject available"));
125
-			}
126
-			else {
123
+			} else {
127 124
 				if (!isset($brokenSO->id)) {
128 125
 					$brokenSO->id = "Unknown ID";
129 126
 					SLog::Write(LOGLEVEL_ERROR, sprintf("PHPWrapper->ImportMessageChange(): Caught SyncObjectBrokenException but no ID of object set"));
@@ -137,8 +134,7 @@  discard block
 block discarded – undo
137 134
 		// substitute the MAPI SYNC_NEW_MESSAGE flag by a grommunio-sync proprietary flag
138 135
 		if ($flags == SYNC_NEW_MESSAGE) {
139 136
 			$message->flags = SYNC_NEWMESSAGE;
140
-		}
141
-		else {
137
+		} else {
142 138
 			$message->flags = $flags;
143 139
 		}
144 140
 
Please login to merge, or discard this patch.